/* The framework owns the silver bar, scroll container and side panel. */
body.reGame #game { overflow:visible; flex:none; min-height:0; }
#REco2 { position:relative; --re-card:clamp(48px,10vh,104px); display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.12fr); gap:clamp(8px,1.5vw,22px); width:100%; min-width:0; padding:10px; box-sizing:border-box; background:#efd18e url('../images/recycling-yard.svg') center/cover; color:#493b29; border-radius:0; box-shadow:inset 0 0 0 1px #fff9; }
#REco2 *, .rePopover * { box-sizing:border-box; }
#REco2 h3 { font-size:clamp(11px,1.05vw,16px); font-weight:700; margin:0; text-align:center; }
#REco2 button { font:inherit; color:inherit; }
#REco2 button:focus-visible { outline:3px solid #172a41; outline-offset:2px; }
#REco2 img { display:block; max-width:100%; object-fit:contain; }
#reFactories { position:relative; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:clamp(4px,.8vw,12px); min-width:0; min-height:0; height:min(100%,830px); align-self:start; }
#REco2 .reMaterial0 { --re-material:#486aab; }
#REco2 .reMaterial1 { --re-material:#47823b; }
#REco2 .reMaterial2 { --re-material:#bb5139; }
#REco2 .reMaterial3 { --re-material:#987418; }
#REco2 .reFactory { border-radius:12px; padding:7px 4px; display:grid; grid-template-rows:minmax(0,1.44fr) minmax(0,1.08fr) minmax(0,1.66fr); align-content:center; gap:7px; min-width:0; min-height:0; background:transparent; border:0; box-shadow:none; }
#REco2 .reRecycle,#REco2 .reDump,#REco2 .reReward { position:relative; display:flex; flex-direction:column; justify-content:center; align-items:center; min-width:0; min-height:0; gap:3px; padding:2px; border:0; background:transparent; border-radius:5px; }
#REco2 .reRecycle,#REco2 .reDump { border:2px solid #b78b4866; background:#fff3cb85; border-radius:16px 12px 18px 11px; box-shadow:0 3px 0 #9b733126; }
#REco2 .reDump { border-style:dashed; background:#f4dcaa66; }
#REco2 .reZoneGlyph { display:block; position:absolute; width:38px; height:38px; top:50%; left:50%; transform:translate(-50%,-50%); color:#9b763c; opacity:.25; pointer-events:none; }
#REco2 .reZoneGlyph svg { display:block; width:100%; height:100%; }
#REco2 .reRewardFan { position:relative; display:block; height:var(--re-fan-height); min-height:0; }
#REco2 .reRewardFan>img { position:absolute; object-fit:contain; border-radius:3px; }
#REco2 .reReward>.reRewardFan { --re-fan-height:clamp(65px,18vh,150px); flex:1; width:min(calc(100% - 28px),120px); margin-right:28px; }
#REco2 .reRewardInfo { position:absolute; display:grid; place-items:center; width:24px; height:24px; min-height:24px; padding:2px; border:0; background:transparent; color:#3e695c; cursor:pointer; z-index:2; }
#REco2 .reRewardInfo svg { display:block; width:20px; height:20px; }
#REco2 .reRewardInfo[aria-expanded="true"] { color:#204b65; }
#REco2 .reRewardInfo:disabled { opacity:.45; cursor:default; }
#REco2 .rePile { position:relative; flex:1; width:100%; min-height:0; }
#REco2 .reCard { display:block; aspect-ratio:92/142; }
#REco2 .rePile .reCard { position:absolute; }
#REco2 .reCard img { width:100%; height:100%; object-fit:contain; }
#reSidebar { min-width:0; min-height:0; display:grid; grid-template-rows:auto auto auto; align-content:start; gap:8px; }
#REco2 .rePlayer { min-width:0; min-height:0; background:#f8f7f1ed; border-radius:11px; padding:7px; border:1px solid #b4b9aa80; border-left:3px solid var(--re-player); box-shadow:0 3px 0 #9b733126; display:flex; flex-direction:column; gap:4px; }
#REco2 .rePlayer header { display:flex; align-items:center; gap:4px; flex-wrap:wrap; min-width:0; font-size:clamp(12px,1.2vw,16px); }
#REco2 .rePlayer header strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#REco2 .reOnTurn { background:#fffffff2; box-shadow:inset 0 0 0 1px var(--re-player); }
#REco2 .reStar { color:#755516; font-size:.75em; }
#REco2 .reRewards { display:grid; grid-template-columns:1fr 1fr; gap:2px; font-size:clamp(10px,1vw,13px); }
#REco2 .reRewards>div { display:flex; align-items:center; padding:0; min-width:0; }
#REco2 .reRewards>div:empty { display:none; }
#REco2 .reRewardTokens { display:flex; flex-wrap:wrap; gap:3px; align-items:center; }
:is(#REco2, #log) .reRewardToken { --re-token-size:26px; position:relative; display:inline-flex; flex:none; justify-content:center; align-items:center; width:var(--re-token-size); height:var(--re-token-size); border:0; background:transparent; color:#283c34; font-family:'Arial Black','Trebuchet MS',sans-serif; font-size:23px; font-weight:900; line-height:1; letter-spacing:-.7px; }
:is(#REco2, #log) .reRewardNumber { -webkit-text-stroke:.6px #fffffff0; paint-order:stroke fill; text-shadow:0 1px 1px #243d2922; }
:is(#REco2, #log) .reRewardToken[data-color="0"] { color:#486aab; }
:is(#REco2, #log) .reRewardToken[data-color="1"] { color:#47823b; }
:is(#REco2, #log) .reRewardToken[data-color="2"] { color:#bb5139; }
:is(#REco2, #log) .reRewardToken[data-color="3"] { color:#987418; }
#REco2 .reRewardToken>img { position:absolute; width:var(--re-token-size); max-width:none; height:calc(var(--re-token-size)*142/92); left:calc((100% - var(--re-token-size))/2); top:calc((100% - var(--re-token-size)*142/92)/2); object-fit:contain; opacity:0; }
#REco2 .reRewardToken>img.reInFlight { opacity:1; }
#REco2 .reRewardToken.reco2-state-1 .reRewardNumber { visibility:hidden; }
#reOpponents .reRewardToken { --re-token-size:18px; font-size:16px; }
#reOpponents .reRewards { display:flex; flex-wrap:wrap; gap:2px 8px; }
#reOpponents .reRewardTokens { gap:1px; }
#REco2 .reTotals { display:flex; gap:5px; align-items:center; font-size:clamp(10px,1vw,13px); color:#65756b; }
#REco2 .reScoreTotal { color:#47614f; font-weight:700; }
#reHand { min-height:0; height:clamp(75px,17vh,180px); display:flex; padding:4px 0 0; }
#REco2 .reHandCards { min-height:0; flex:1; display:flex; align-items:center; justify-content:center; padding:3px; }
#REco2 .reHandCard { flex:1 1 0; min-width:0; max-width:calc(var(--re-card)*.95); padding:0; border:0; border-radius:5px; background:transparent; transition:transform .1s; }
#REco2 .reHandCard .reCard { display:block; }
#REco2 .reHandCards>.reCard { flex:1 1 0; min-width:0; }
#REco2 .reHandCard { position:relative; }
#REco2 .reSelected { transform:translateY(-5px); outline:3px solid #1d4565; }
#REco2 .reHandCard.active,#REco2 .reRecycle.active { cursor:pointer; }
#REco2 .reRecycle.active { background:#fff0ad; border-color:#87562b; box-shadow:inset 0 0 0 2px #fffbe5,0 0 0 3px #e5a82a,0 5px 0 #87562b55; }
#REco2 .reRecycle.active:hover { transform:translateY(-3px); background:#fff8d4; }
#REco2 .rePile .reCard, #REco2 .reRewardFan>img { filter:drop-shadow(0 2px 2px #68451b38); }
#reOpponents { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-auto-rows:max-content; align-content:start; gap:6px; min-height:0; }
#REco2 .reOtherHand { display:flex; min-height:0; height:var(--re-other-height,clamp(44px,8vh,110px)); flex:none; align-items:center; }
#REco2 .reOtherHand .reCard { display:block; min-width:0; flex:none; max-width:90px; }
#reSupply { display:flex; flex-wrap:wrap; gap:6px 12px; justify-content:center; align-items:center; font-size:12px; padding:4px; background:transparent; border:0; }
#REco2 .reSupplyPile { display:flex; gap:6px; align-items:center; white-space:nowrap; padding:4px 10px; border-radius:18px; background:#fff5dcde; box-shadow:0 2px 0 #9b733126; }
#REco2 .reCardStack { position:relative; display:block; width:29px; height:40px; flex:none; padding:0; border:0; background:transparent; }
#REco2 .reDeck { cursor:pointer; }
#REco2 .reCardStack>.reCard { position:absolute; width:20px; height:calc(20px*142/92); bottom:calc(var(--re-index)*2px); left:calc(var(--re-index)*1px); }
#REco2 .rePersonalDump { display:inline-block; width:14px; height:16px; margin-right:4px; vertical-align:middle; }
#REco2 .rePersonalDump>.reCard { width:9px; height:calc(9px*142/92); bottom:calc(var(--re-index)*1px); }
#REco2 .rePersonalDump .reZoneGlyph { width:14px; height:16px; opacity:.7; }
#REco2 .rePersonalDump>.reCard:not(.reInFlight):not(.reco2-state-2) { visibility:hidden; }
#REco2 .rePersonalDump>.reCard:is(.reInFlight,.reco2-state-2) { visibility:visible; }
#REco2 .reDeckInfo { position:absolute; bottom:0; right:-2px; border-radius:50%; background:#fff; color:#204b65; font-size:14px; line-height:16px; }
#REco2 .reInFlight { position:relative; z-index:1000; pointer-events:none; }
.rePopover { max-width:min(360px,90vw); }
.rePopover:is(.reco2-state-3,.reco2-state-4,.reco2-state-5) { max-width:min(390px,95vw); border:2px solid #a77b3e; border-radius:18px 14px 20px 15px; box-shadow:0 5px 0 #80562555,0 12px 28px #68451b40; background:radial-gradient(ellipse at 15% 0%,#fff9e4aa,transparent 65%),repeating-linear-gradient(4deg,transparent 0 32px,#b8904b0a 33px 34px),#f5dfaa; }
.rePopover .reRewardDetails { width:min(330px,calc(95vw - 34px)); max-height:65vh; overflow:auto; color:#344c3e; }
.rePopover .reRewardSequence { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px 8px; }
.rePopover .reRewardPreview { position:relative; }
.rePopover .reRewardPreview small { position:absolute; z-index:1; top:3px; right:3px; min-width:17px; padding:1px 4px; border-radius:5px; background:#fff3cf; color:#775429; border:1px solid #b58c49; box-shadow:0 1px 2px #68451b33; font-size:10px; text-align:center; }
.rePopover .reRewardPreview img { display:block; width:100%; height:auto; border-radius:4px; filter:drop-shadow(0 3px 2px #68451b40); }
.rePopover .reRewardPreview:first-child { outline:2px solid #b4822c; outline-offset:2px; border-radius:4px; }
.rePopover.reco2-state-4 { max-width:min(440px,95vw); }
.rePopover .reInfoClose { float:right; border:0; background:transparent; font-size:20px; line-height:20px; margin:0 0 6px 8px; }
.rePopover .reSupplyInfo { width:min(380px,calc(95vw - 32px)); max-height:65vh; overflow:auto; }
.rePopover .reSupplyInfo p { font-size:12px; margin:6px 0; }
.rePopover .reSupplyCards { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px 10px; padding:8px 2px; }
.rePopover .reSupplyType { position:relative; }
.rePopover .reSupplyType .reCard { display:block; width:100%; }
.rePopover .reSupplyType img { display:block; width:100%; height:auto; }
.rePopover .reSupplyQuantity { position:absolute; top:-5px; right:-3px; min-width:26px; padding:2px 7px; border-radius:20px; background:#fffaf0; border:1px solid #ad925d; color:#493b29; box-shadow:0 2px 3px #68451b33; text-align:center; font-size:14px; }
.rePopover .reUnavailable .reCard { opacity:.35; }
#REco2.reNarrow { height:auto!important; grid-template-columns:1fr; grid-template-rows:auto auto; align-content:start; gap:8px; }
#REco2.reNarrow #reFactories { height:var(--re-factory-height); }
#REco2.reNarrow #reSidebar { grid-template-columns:1fr; grid-template-rows:auto auto auto; }
#REco2.reNarrow #reOwn { grid-column:1; }
#REco2.reNarrow #reHand { height:calc(var(--re-narrow-card)*142/92 + 10px); }
#REco2.reNarrow #reOpponents { grid-column:1; grid-row:2; grid-template-columns:repeat(4,minmax(0,1fr)); }
#REco2.reNarrow #reSupply { grid-column:1/-1; }
#REco2.reNarrow .reRewards { grid-template-columns:1fr; }
#REco2.reNarrow .reRewardToken { --re-token-size:18px; font-size:16px; }
#REco2.rePhone #reOpponents { grid-template-columns:repeat(2,minmax(0,1fr)); grid-auto-rows:max-content; }
@media(prefers-reduced-motion:reduce) { #REco2 .reHandCard { transition:none; } }

#REco2 .rePlayer header .reTotals { margin-left:auto; flex:none; }

.rePopover.reco2-state-3 .popover-body { padding:12px; }
.rePopover.reco2-state-3 .reInfoClose { color:#76502a; background:#fff5d9; border:1px solid #b58c49; border-radius:50%; width:24px; height:24px; padding:0; }
.rePopover.reco2-state-3 .popover-arrow::after { border-top-color:#f5dfaa; border-bottom-color:#f5dfaa; }

#REco2 .reHandSlot { flex:none; display:block; aspect-ratio:92/142; border:1px dashed #bc985a66; border-radius:5px; background:#bc985a0a; }
#REco2 .reScoreInfo { display:inline-flex; align-items:center; gap:5px; border:1px solid #9aa99c80; border-radius:20px; padding:3px 6px; background:#edf1e9; color:#47614f; cursor:pointer; line-height:1; }
#REco2 .reInfoIcon { display:block; width:16px; height:16px; flex:none; }
#REco2 .reFactoryHelp { position:absolute; z-index:3; top:2px; left:2px; display:grid; place-items:center; width:24px; height:24px; padding:3px; border:1px solid #85988c; border-radius:50%; background:#f8faf3; color:#405f50; font-weight:700; cursor:pointer; }
.reFactoryDetails { max-height:60vh; overflow:auto; color:#493b29; }
.reFactoryDetails h3 { margin:0 24px 12px 0; font-size:16px; }
.reFactoryDetails p { font-size:13px; margin:8px 0; }
#REco2.reNarrow .rePlayer header strong { flex:1 1 65px; }
#REco2.reNarrow .rePlayer header .reTotals { gap:3px; }
#REco2.reNarrow #reOpponents { grid-template-columns:repeat(2,minmax(0,1fr)); }
.rePopover.reco2-state-6 { border:2px solid #a77b3e; border-radius:16px; background:#f5dfaa; box-shadow:0 5px 0 #80562555,0 12px 28px #68451b40; }
.reScoringDetails { width:min(300px,calc(90vw - 32px)); max-height:60vh; overflow:auto; color:#684b2b; }
.reScoringRow { display:flex; align-items:center; gap:8px; padding:5px 0; border-bottom:1px solid #b58c4944; }
.reScoringRow>b { margin-left:auto; }
.reScoringCards { display:flex; flex-wrap:wrap; }
.reScoringDetails p { font-size:12px; margin:10px 0; }
.reScoringTotal { text-align:right; font-size:16px; font-weight:bold; margin-top:8px; }
.rePopover .reRewardToken { width:22px; height:24px; font-weight:900; }
.rePopover .reRewardToken>img { display:none; }
.rePopover .reRewardToken[data-color="0"] { color:#486aab; }
.rePopover .reRewardToken[data-color="1"] { color:#47823b; }
.rePopover .reRewardToken[data-color="2"] { color:#bb5139; }
.rePopover .reRewardToken[data-color="3"] { color:#987418; }

:is(#REco2, .rePopover, #log) .reCard { position:relative; }
:is(#REco2, .rePopover, #log) .reSymbolCount { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); width:36%; max-width:28px; min-width:14px; height:auto; overflow:visible; pointer-events:none; filter:drop-shadow(0 1px 2px #38271388); }
.reSymbolCount circle { fill:#3662a3; stroke:#fff9e8; stroke-width:1.8; }
.reSymbolCount[data-color="1"] circle { fill:#347538; }
.reSymbolCount[data-color="2"] circle { fill:#b8442c; }
.reSymbolCount[data-color="3"] circle { fill:#f0c84c; }
.reSymbolCount text { fill:#fff; font:bold 18px 'Trebuchet MS',sans-serif; }
.reSymbolCount[data-color="3"] text { fill:#4d3517; }

#REco2 .rePile .reCard, #REco2 .reCardStack>.reCard { position:absolute; }

#REco2 .rePile>.reCard:not(:last-child) .reSymbolCount { top:2px; transform:translateX(-50%); width:27%; max-width:21px; min-width:12px; }

#REco2 .reRewards { display:flex; flex-wrap:wrap; gap:3px 8px; }
:is(#REco2, #log, .rePopover) .reRewardToken { display:inline-flex; align-items:center; justify-content:center; border-radius:4px; background:#3564a5; color:#fff; box-shadow:inset 0 0 0 1px #00000015; }
:is(#REco2, #log, .rePopover) .reRewardToken[data-color="0"] { background:#3564a5; color:#fff; }
:is(#REco2, #log, .rePopover) .reRewardToken[data-color="1"] { background:#347538; color:#fff; }
:is(#REco2, #log, .rePopover) .reRewardToken[data-color="2"] { background:#bf442b; color:#fff; }
:is(#REco2, #log, .rePopover) .reRewardToken[data-color="3"] { background:#f0cb48; color:#493414; }
:is(#REco2, #log, .rePopover) .reRewardNumber { -webkit-text-stroke:0; text-shadow:none; letter-spacing:0; }

.reScoringDetails .reRewardTokens { display:flex; flex-wrap:wrap; gap:4px; }

.rePopover .popover-header { background:transparent; border-bottom:1px solid #b58c4944; color:#684b2b; }
.rePopoverHeading { display:flex; align-items:center; justify-content:space-between; gap:16px; font-weight:700; }
.rePopover .rePopoverHeading .reInfoClose { float:none; margin:0; flex:none; }
#REco2 .reScoreInfo .reZoneGlyph { position:static; transform:none; width:18px; height:18px; color:currentColor; opacity:1; }

#REco2 .reFactoryHelp svg { display:block; width:100%; height:100%; }
#REco2 .reRewardInfo { top:4px; right:2px; }
#REco2 .reTutorialLink { position:absolute; z-index:3; top:2px; left:32px; padding:2px 7px; font-size:12px; border:1px solid #85988c; border-radius:12px; color:#405f50; background:#f8faf3; }
#REco2 { padding-top:32px; }
#REco2.reNarrow { padding:28px 4px 4px; gap:4px; }
#REco2.reNarrow .reFactory { padding:0; gap:4px; grid-template-rows:var(--re-delivery-height) var(--re-reward-height) var(--re-collect-height); }
#REco2.reNarrow .reRecycle,#REco2.reNarrow .reDump { border-width:1px; padding:1px; }
#REco2.reNarrow #reSidebar { gap:4px; }
#REco2.reNarrow .rePlayer { padding:4px; gap:2px; }
#REco2 .reRewards.reEmptyRewards { display:none; }
#REco2.reNarrow #reHand { height:calc(var(--re-narrow-card)*142/92 + 4px); padding:0; }
#REco2.reNarrow .reHandCards { padding:0; }
#REco2.reNarrow #reOpponents { gap:4px; }
#REco2.reNarrow #reSupply { gap:4px 8px; padding:0; }
#REco2.reNarrow .reSupplyPile { padding:2px 6px; }
#REco2.reNarrow .rePile>.reCard:not(:last-child) .reSymbolCount { max-width:17px; }
