/* The board has fixed geometry; player panels and controls keep readable sizes. */
#game.eoi-game { background: #cdb78d; min-height: 100%; padding: 6px; gap: 8px; align-items: start; }
#game.eoi-game #board { flex: 1 1 auto; min-width: 0; width: auto; }
#game.eoi-game #playerData { flex: 0 0 216px; width: 216px; margin: 0; display: flex; flex-direction: column; gap: 5px; }
#game.eoi-game .playerData { border: 1px solid #806545; border-left: 4px solid var(--piece-color); border-radius: 6px; padding: 5px; background: var(--player-tint, #faf1df); }
#game.eoi-game #logo, #game.eoi-game .symbol { display: none; }
#log .symbol { display: none; }
#game.eoi-game .eoi-bonus-action.active, #game.eoi-game .eoi-available-factories { cursor: pointer; outline: 2px solid #206f94; outline-offset: 1px; }
#game.eoi-game .playerInfoRank, #game.eoi-game .playerInfoFlag { display: none; }
#game.eoi-game .playerInfoLogin { overflow-wrap: anywhere; }
#game.eoi-game .playerInfoLogin { font-weight: normal; font-style: normal; }
#game.eoi-game .eoi-disc-reserve { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 20px; margin-right: 5px; margin-bottom: 3px; vertical-align: middle; border-radius: 50%; box-sizing: border-box; font-size: 12px; font-weight: bold; font-style: normal; color: #fff; text-shadow: 0 1px 2px #000; }
#game.eoi-game .eoi-star { color: #6d4f13; font-size: .75em; }
.eoi-resource { display: inline-flex; gap: 2px; align-items: center; white-space: nowrap; }
/* Values stay in the DOM; container queries spend small cards' space on costs/output. */
.eoi-card { display: inline-block; width: 185px; aspect-ratio: 64 / 94; container-type: inline-size; vertical-align: middle; color: #241f18; text-align: left; font-style: normal; font-weight: normal; line-height: 1; }
.eoi-card-face { display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: auto auto minmax(0,1fr) auto; width: 100%; height: 100%; overflow: hidden; box-sizing: border-box; border: 1px solid #75654d; border-radius: 5px; background: #ebe5d4; }
.eoi-card-factory .eoi-card-face { background: #b7d9cb; }
.eoi-card-fake .eoi-card-face { border-color: #9c682e; background: #e7c99b; }
.eoi-card-heading { padding: 5px 6px; font-size: 6cqw; line-height: 1.1; font-weight: bold; }
.eoi-card-output, .eoi-card-cost { display: flex; align-items: center; gap: 4px; justify-content: space-between; min-width: 0; }
.eoi-card-output { background: #fff7e3; padding: 5px; }
.eoi-card-factory .eoi-card-output { background: #edf6ed; }
.eoi-card .eoi-resource { gap: 1px; min-width: 0; justify-content: center; }
.eoi-card .eoi-resource b, .eoi-card-free { font-size: clamp(9px, 19cqw, 30px); line-height: 1; font-variant-numeric: tabular-nums; }
.eoi-card .eoi-resource img { display: inline-block; width: clamp(8px, 17cqw, 27px); height: clamp(8px, 17cqw, 27px); max-width: none; margin: 0; object-fit: contain; vertical-align: middle; }
.eoi-card .eoi-card-output .eoi-resource b { font-size: clamp(11px, 24cqw, 38px); }
.eoi-card .eoi-card-output .eoi-resource img { width: clamp(10px, 21cqw, 33px); height: clamp(10px, 21cqw, 33px); }
.eoi-card-illustration { display: block; width: 100%; height: 100%; min-height: 0; overflow: hidden; }
.eoi-card-payment { background: #fffdf2; padding: 5px; border-top: 1px solid #75654d50; }
.eoi-card-label { display: block; font-size: 6cqw; padding-bottom: 4px; color: #71624b; }
.eoi-card-cost { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 3px 1px; }
.eoi-card[data-cost-count="1"] .eoi-card-cost, .eoi-card[data-cost-count="0"] .eoi-card-cost { grid-template-columns: 1fr; }
.eoi-card-points { margin-left: auto; border-left: 1px solid #75654d50; padding-left: 3px; }
.eoi-card-any-cube { display: inline-flex; align-items: center; justify-content: center; width: clamp(8px,17cqw,27px); height: clamp(8px,17cqw,27px); border: 1px solid #614321; border-radius: 2px; background: #e9d39d; font-size: clamp(8px,15cqw,22px); font-weight: bold; }
.eoi-card-or { font-size: clamp(8px,13cqw,18px); }
@container (min-width: 141px) {
    .eoi-card-cost { display: flex; justify-content: space-around; gap: 2px; }
    .eoi-card[data-cost-count="4"] .eoi-card-cost, .eoi-card[data-cost-count="5"] .eoi-card-cost { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
    .eoi-card .eoi-card-cost .eoi-resource b { font-size: 14cqw; }
    .eoi-card .eoi-card-cost .eoi-resource img, .eoi-card-any-cube { width: 13cqw; height: 13cqw; }
}
@container (max-width: 140px) {
    .eoi-card-heading, .eoi-card-label { display: none; }
    .eoi-card-face { grid-template-rows: auto minmax(0,1fr) auto; border-radius: 3px; }
    .eoi-card-output, .eoi-card-payment { padding: 2px 1px; }
    .eoi-card-output { gap: 1px; }
}
@container (max-width: 45px) {
    .eoi-card-cost .eoi-resource { flex-direction: column; gap: 0; }
    .eoi-card-cost { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0; }
    .eoi-card .eoi-card-cost .eoi-resource b { font-size: 8px; }
    .eoi-card .eoi-card-cost .eoi-resource img, .eoi-card .eoi-card-any-cube { width: 7px; height: 7px; font-size: 7px; }
    .eoi-card-output, .eoi-card-payment { padding: 1px 0; }
    .eoi-card .eoi-card-points { padding-left: 0; }
    .eoi-card .eoi-card-output .eoi-resource b { font-size: 9px; }
    .eoi-card .eoi-card-output .eoi-resource img { width: 8px; height: 8px; }
    .eoi-card-choice { flex-wrap: wrap; }
}
.eoi-resource-flight { z-index: 200; pointer-events: none; width: 24px; height: 24px; object-fit: contain; }
.eoi-market-dialog .modal-content { background: #faf1df; color: #382c1b; border: 1px solid #806545; border-radius: 10px; }
.eoi-market-dialog .modal-header { background: #eee0bd; border-bottom-color: #80654540; }
.eoi-market-dialog .modal-dialog { max-width: 480px; }
.eoi-exchange-instruction { margin: 0 0 12px; font-size: .9rem; }
.eoi-exchange-list { display: flex; flex-direction: column; gap: 7px; }
.eoi-exchange-option { display: grid; grid-template-columns: 1fr 32px 1fr; align-items: center; gap: 8px; min-height: 54px; padding: 8px 12px; background: #fffaf0; border: 1px solid #a88a59; border-radius: 6px; color: inherit; text-align: center; }
.eoi-exchange-option:not(:disabled) { cursor: pointer; }
.eoi-exchange-option:not(:disabled):hover, .eoi-exchange-option:focus-visible { background: #fff0c4; outline: 2px solid #075574; outline-offset: 1px; }
.eoi-exchange-option:disabled { opacity: .4; }
.eoi-exchange-option .eoi-resource { justify-content: center; font-size: 1.1rem; gap: 8px; }
.eoi-market-dialog .eoi-resource img { width: 28px; height: 28px; object-fit: contain; }
.eoi-exchange-arrow { font-size: 1.4rem; color: #806545; }
.eoi-exchange-preview { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; padding: 12px; margin-bottom: 14px; border-radius: 6px; background: #eee0bd; }
.eoi-exchange-resources { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.eoi-exchange-resources .eoi-exchange-option { display: flex; flex-direction: column; gap: 4px; }
.eoi-production-preview { position: absolute; display: flex; flex-wrap: wrap; align-items: center; gap: 3px 7px; max-width: 150px; font-size: 12px; line-height: 1.2; color: #241b10; text-shadow: 0 0 3px #fff, 0 0 3px #fff; pointer-events: none; z-index: 3; }
.eoi-production-preview img { width: 20px; height: 20px; object-fit: contain; }
.eoi-production-factory { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.eoi-production-factory > .eoi-card { width: 48px; height: auto; flex: none; }
.eoi-production-mixes { display: flex; gap: 5px; flex: 1; min-width: 0; }
.eoi-production-mix { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 1; min-width: 0; padding: 8px 3px; background: #fffaf0; border: 1px solid #a88a59; border-radius: 6px; cursor: pointer; }
.eoi-production-mix.eoi-production-chosen { background: #fff0c4; outline: 2px solid #075574; outline-offset: 0; }
.eoi-production-total { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px; border-radius: 6px; background: #eee0bd; }
.eoi-production-total > strong { flex-basis: 100%; }
#game.eoi-game .playerData { line-height: 1.1; padding: 2px; }
#game.eoi-game .playerDataBasic { padding: 2px 0; }
#game.eoi-game .playerData > * { padding: 1px 0; }
#game.eoi-game .playerDataDetail { line-height: 1.1; }
#game.eoi-game .eoi-materials, #game.eoi-game .eoi-economy { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 2px; align-items: start; }
#game.eoi-game .eoi-material, #game.eoi-game .eoi-stat { padding: 0; margin: 0; border: 0; background: transparent; color: #241f14; font: inherit; min-width: 0; text-align: center; }
#game.eoi-game .eoi-material { display: block; position: relative; height: 32px; cursor: default; }
#game.eoi-game .eoi-material img { display: block; width: 32px; height: 32px; margin: auto; }
#game.eoi-game .eoi-material b { position: absolute; left: calc(50% - 2px); top: 18px; transform: translate(-50%,-50%); color: #fff; font-size: 15px; line-height: 1; text-shadow: 0 1px 2px #241f16; font-variant-numeric: tabular-nums; }
#game.eoi-game .eoi-material-2 b, #game.eoi-game .eoi-material-3 b { color: #17232c; text-shadow: 0 1px 0 #ffffff80; }
#game.eoi-game .eoi-material.eoi-long-value b { font-size: 12px; }
#game.eoi-game .eoi-economy { margin-top: 1px; }
#game.eoi-game .eoi-stat { display: flex; flex-direction: column; align-items: center; gap: 0; line-height: 1; cursor: default; }
#game.eoi-game .eoi-stat img { width: 24px; height: 24px; display: block; object-fit: contain; }
#game.eoi-game .eoi-stat-value { min-height: 15px; display: flex; align-items: baseline; justify-content: center; gap: 2px; white-space: nowrap; font-size: .85rem; line-height: 15px; font-variant-numeric: tabular-nums; }
#game.eoi-game .eoi-pending-bonus { font-size: .7rem; color: #69531e; }
#game.eoi-game .eoi-score-info, #game.eoi-game .eoi-inspect-player { cursor: pointer; }
#game.eoi-game .eoi-player-facts { display: flex; justify-content: center; align-items: center; gap: 3px; font-size: .72rem; line-height: 15px; margin-top: 0; }
#game.eoi-game .eoi-player-facts img { width: 15px; height: 15px; }
#game.eoi-game .eoi-stat:focus-visible { outline: 2px solid #206f94; outline-offset: 0; border-radius: 3px; }
#EraOfInventions2 { --board-width: 765px; width: 100%; color: #382c1b; }
#EraOfInventions2 .eoi-surface { width: var(--board-width); max-width: 100%; aspect-ratio: 765 / 593; position: relative; margin: 0 auto; }
#EraOfInventions2 .eoi-board-art { width: 100%; height: auto; display: block; border-radius: 4px; }
#EraOfInventions2 .eoi-surface button { position: absolute; border: 0; padding: 0; margin: 0; background: transparent; cursor: default; color: #17120c; font-weight: bold; }
#EraOfInventions2 .eoi-offer .eoi-card { width: 100%; height: 100%; object-fit: fill; display: block; }
#EraOfInventions2 .eoi-token { border-radius: 50%; background: var(--piece-color); font-size: .65rem; }
#EraOfInventions2 .eoi-token { z-index: 2; }
#EraOfInventions2 .eoi-token.eoi-occupied,
#EraOfInventions2 .eoi-development.eoi-owned::before,
#EraOfInventions2 .eoi-pawn,
#game.eoi-game .eoi-disc-reserve {
    /* A painted wooden face over a shallow, shaded rim; keep the hit area unchanged. */
    background-color: var(--piece-color);
    background-image: linear-gradient(155deg, #ffffff30, #ffffff00 48%, #00000018),
        repeating-linear-gradient(8deg, #ffffff08 0, #ffffff08 1px, #00000008 2px, #00000000 4px);
    border: 1px solid #39240e80;
    box-shadow: inset 0 1px 1px #ffffff70, inset 0 -1px 1px #00000030,
        0 1px 0 #49321d, 0 3px 0 #62472d, 0 4px 3px #20130080;
}
#EraOfInventions2 .eoi-development.eoi-owned { font-size: .65rem; text-align: left; padding-left: 4px; }
#EraOfInventions2 .eoi-development.eoi-owned::before { content: ''; position: absolute; left: 0; top: 20%; width: 40%; height: 65%; box-sizing: border-box; border-radius: 50%; z-index: -1; }
#EraOfInventions2 .eoi-development { isolation: isolate; }
#EraOfInventions2 .eoi-store { font-size: .85rem; overflow: visible; }
#EraOfInventions2 .eoi-store-cubes { position: absolute; inset: 0; pointer-events: none; }
#EraOfInventions2 .eoi-store-cube { position: absolute; width: 70%; height: auto; left: 0; top: 16%; pointer-events: none; }
#EraOfInventions2 .eoi-store-cube:nth-child(2) { left: 28%; top: 0; }
#EraOfInventions2 .eoi-store-cube:nth-child(3) { left: 20%; top: 30%; }
#EraOfInventions2 .eoi-store-cube:nth-child(4) { left: 4%; top: 40%; }
#EraOfInventions2 .eoi-store-count { position: absolute; right: -7px; bottom: -2px; min-width: 18px; padding: 1px 3px; border: 1px solid #806545; border-radius: 4px; background: #fff4d9; color: #241b10; line-height: 1.1; font-variant-numeric: tabular-nums; box-shadow: 0 1px 2px #20130060; pointer-events: none; }
#EraOfInventions2 .eoi-pawn { position: absolute; box-sizing: border-box; border-radius: 50%; pointer-events: none; }
#EraOfInventions2 .eoi-surface .eoi-inspect { cursor: pointer; display: flex; align-items: center; justify-content: center; background: #342c23; color: #fff4d9; border: 1px solid #e8d3a5; border-radius: 4px; line-height: 1; font-size: .7rem; box-shadow: 0 1px 3px #0008; z-index: 3; }
#EraOfInventions2 .eoi-inspect:hover { background: #655035; }
#EraOfInventions2 .eoi-round-status { position: absolute; top: 50.25%; left: 51.6%; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; white-space: nowrap; }
#EraOfInventions2 .eoi-round { background: #faf0db; padding: 2px 5px; border-radius: 3px; font-size: .8rem; }
#EraOfInventions2 .eoi-round-space { position: absolute; border-radius: 50%; pointer-events: none; box-sizing: border-box; }
#EraOfInventions2 .eoi-round-unused { background: rgb(80 73 56 / 25%); }
#EraOfInventions2 .eoi-round-completed { background: rgb(20 17 12 / 65%); }
#EraOfInventions2 .eoi-round-current { border: 2px solid #12617d; box-shadow: 0 0 0 1px #fff4cf; }
#EraOfInventions2 .eoi-round-final { border-color: #b51919; }
#EraOfInventions2 .eoi-last-round { color: #a41414; background: #faf0db; border-radius: 3px; padding: 2px 5px; text-align: center; font-weight: bold; font-size: .8rem; line-height: 1.2; }
#EraOfInventions2 .eoi-tools { padding: 4px; min-height: 42px; background: #ecdfc3; border-radius: 4px; }
#EraOfInventions2 .eoi-tools.eoi-empty-tools { display: none; }
#EraOfInventions2 .eoi-context { font-size: .85rem; font-weight: 600; }
#EraOfInventions2 .eoi-choices { display: flex; flex-wrap: wrap; gap: 4px; }
#EraOfInventions2 button { cursor: default; }
#EraOfInventions2 button.active { cursor: pointer; outline: 2px solid #206f94; outline-offset: -2px; background-color: #e7f3f7b0; }
#EraOfInventions2 .eoi-surface .eoi-withdraw { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; background: #fff4d9; color: #342c23; border: 2px solid #075574; border-radius: 6px; box-shadow: 0 2px 4px #0006; font-size: 1.1rem; z-index: 4; }
#EraOfInventions2 .eoi-withdraw:hover { background: #ffe5a4; }
#EraOfInventions2 .eoi-offer.active { outline: 3px solid #fff; outline-offset: 0; box-shadow: 0 0 0 6px #075574; z-index: 1; }
#EraOfInventions2 .eoi-selected { box-shadow: inset 0 0 0 3px #f7cf48; outline: 2px dashed #30240f; }
#EraOfInventions2 .eoi-offer.eoi-selected { outline: 3px dashed #35250a; outline-offset: 0; box-shadow: 0 0 0 6px #ffd34e; z-index: 1; }
#EraOfInventions2 button:focus-visible { outline: 3px solid #235b96; }
#game.eoi-game.eoi-stacked { flex-direction: column; }
#game.eoi-game.eoi-stacked #playerData { order: 0; flex: none; width: 100%; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
#game.eoi-game.eoi-stacked #board { order: 1; flex: none; width: 100%; }
#game.eoi-game.eoi-stacked.eoi-narrow-players #playerData { grid-template-columns: repeat(2,minmax(0,1fr)); }
.eoi-popover { max-width: min(94vw, 650px); background: #faf1df; }
.eoi-popover .eoi-card { width: 185px; max-width: 100%; height: auto; }
.eoi-popover .eoi-factory-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 65vh; overflow: auto; }
.eoi-popover .eoi-factory-list .eoi-card { width: 115px; }
.eoi-popover .eoi-owned-factory { padding: 0; border: 0; background: transparent; cursor: default; }
.eoi-popover .eoi-owned-factory.active { cursor: pointer; outline: 3px solid #206f94; }
.eoi-popover .eoi-score-detail { width: 430px; max-width: 100%; color: #382c1b; }
.eoi-score-totals { display: flex; gap: 8px; margin-bottom: 14px; }
.eoi-score-metric { flex: 1; min-width: 0; padding: 9px 8px; background: #ffffff80; border: 1px solid #80654530; border-radius: 6px; }
.eoi-score-metric span { display: block; font-size: .78rem; line-height: 1.3; }
.eoi-score-metric strong { display: block; margin-top: 3px; font-size: 1.65rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.eoi-score-metric.eoi-score-total { background: #eee0af; border-color: #b49748; }
.eoi-score-breakdown { width: 100%; border-collapse: collapse; font-size: .82rem; }
.eoi-score-breakdown th, .eoi-score-breakdown td { padding: 8px 5px; border-bottom: 1px solid #80654530; }
.eoi-score-breakdown thead th { color: #746044; font-size: .73rem; font-weight: normal; }
.eoi-score-breakdown th:first-child { text-align: left; }
.eoi-score-breakdown th:not(:first-child), .eoi-score-breakdown td { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.eoi-score-breakdown tbody th { font-weight: normal; }
.eoi-score-breakdown img { width: 24px; height: 24px; object-fit: contain; margin-right: 7px; vertical-align: middle; }
.eoi-score-breakdown .eoi-score-bonus { font-weight: bold; color: #746044; }
.eoi-score-awarded .eoi-score-bonus { color: #365b29; }
.eoi-popover .eoi-score-note { margin: 12px 0 0; font-size: .76rem; line-height: 1.45; color: #746044; }
/* IDs deliberately outrank framework move/color and generic log image selectors. */
#log .move.color0 { background-color: #3d82be; color: #fff; }
#log .move.color1 { background-color: #e4bc42; color: #30250a; }
#log .move.color2 { background-color: #bf5143; color: #fff; }
#log .move.color3 { background-color: #6c9e59; color: #172311; }
#log .move.color4 { background-color: #875a9c; color: #fff; }
#log .eoi-log .eoi-card { width: 64px; height: 94px; vertical-align: middle; cursor: pointer; }
#log .eoi-log .eoi-resource:not(.eoi-card .eoi-resource) img { display: inline-block; width: 19px; height: 21px; object-fit: contain; vertical-align: middle; }
#log .eoi-log-location { border: 0; padding: 0 2px; color: inherit; background: transparent; font: inherit; text-decoration: underline dotted; cursor: pointer; }
#EraOfInventions2 .eoi-log-highlight { outline: 3px solid #fff; box-shadow: 0 0 0 5px #875118; }
@media(max-width:500px) {
    #game.eoi-game.eoi-stacked #playerData { grid-template-columns: repeat(2,minmax(0,1fr)); }
    #EraOfInventions2 .eoi-choices .btn { min-height: 36px; }
}
