.reward-rack { margin-top: 6px; padding-top: 8px; border-top: 1px solid #a68a535c; }
.promo:has(> .road-owner) { padding-top: 44px; }
.road-owner { position: absolute; left: 50%; top: 0; transform: translateX(-50%); z-index: 4; width: 32px; height: 32px; border: 2px solid var(--owner-color); border-radius: 50%; background: #211c15; box-shadow: 0 2px 5px #0009; pointer-events: none; }
.road-owner::after { content: ""; position: absolute; left: 10px; bottom: -7px; width: 8px; height: 8px; background: #211c15; border-right: 2px solid var(--owner-color); border-bottom: 2px solid var(--owner-color); transform: rotate(45deg); }
.road-owner .avatar { display: block; width: 32px; height: 32px; }
.road-point { position: fixed; z-index: 5100; padding: 3px 8px; border: 2px solid var(--owner-color); border-radius: 20px; background: #292217; color: #ffe193; font: 900 20px/1.2 system-ui, sans-serif; box-shadow: 0 3px 8px #0009; pointer-events: none; }
.road-point.returning { background: #51332e; }
img[data-card-tint="E"] { filter: grayscale(1) sepia(.65) hue-rotate(95deg) saturate(1.1); }
img[data-card-tint="G"] { filter: grayscale(1) sepia(.65) hue-rotate(165deg) saturate(1.2); }
img[data-card-tint="R"] { filter: grayscale(1); }
img[data-card-tint="T"] { filter: grayscale(1) sepia(.8) saturate(1.25); }
.market-order { position: absolute; top: 3px; left: 3px; min-width: 22px; border: 2px solid #ffe193; border-radius: 50%; background: #292217; color: #ffe193; font: 800 16px/22px system-ui, sans-serif; }
#privatePeekPanel { position: fixed; z-index: 1700; display: grid; gap: 4px; max-width: calc(100vw - 16px); box-sizing: border-box; padding: 6px; border: 1px solid #c09b57; border-radius: 8px; background: #211b15; color: #ffe6af; box-shadow: 0 4px 12px #0007; font: 600 12px/1.3 system-ui, sans-serif; }
#privatePeekPanel::before { content: ''; position: absolute; top: -6px; left: var(--peek-arrow-x); width: 10px; height: 10px; transform: translateX(-50%) rotate(45deg); background: #211b15; border: solid #c09b57; border-width: 1px 0 0 1px; }
#privatePeekPanel[hidden] { display: none; }
#peekTokens { flex: none; margin-inline-start: clamp(10px, 1vw, 18px); text-shadow: none; }
.peek-token-emblem { position: relative; display: grid; place-items: center; inline-size: clamp(22px, 1.2em, 30px); aspect-ratio: 1; box-sizing: border-box; border: 1px solid #8a6431; border-radius: 50%; color: #ffe6af; background: radial-gradient(circle at 35% 25%, #856133, #3e2a18 78%); box-shadow: inset 0 0 0 2px #dbb573, 0 1px 2px #24140066; }
button.peek-token-emblem { cursor: pointer; padding: 0; }
button.peek-token-emblem:hover, button.peek-token-emblem[aria-pressed="true"] { filter: brightness(1.16); }
button.peek-token-emblem:focus-visible { outline: 2px solid #8a6431; outline-offset: 3px; }
.peek-token-emblem svg { width: 65%; }
.pd-peek-count.peek-token-emblem { display: inline-grid; vertical-align: middle; inline-size: 22px; margin-inline: 14px 6px; }
.peek-token-count { position: absolute; right: -5px; bottom: -3px; display: grid; place-items: center; min-width: 14px; height: 14px; box-sizing: border-box; padding: 0 3px; border: 1px solid #ffe4a8; border-radius: 999px; background: #50351d; color: #fff6db; font: 800 10px/1 system-ui, sans-serif; }
#scorePanel .score-row.peek-target .avatar { outline: 2px solid #ffdc7f; outline-offset: 1px; box-shadow: 0 0 9px #ffc44d; }
.peek-prompt { margin: 0; text-align: center; }
.private-hand { display: flex; gap: 4px; align-items: flex-start; width: 100%; min-height: 0; overflow-x: auto; }
.private-card { display: flex; flex-direction: column; flex: 0 0 auto; width: clamp(38px, 5vw, 72px); max-height: 100%; border: 1px solid var(--tc); border-radius: 5px; overflow: hidden; }
.private-card img { display: block; width: 100%; min-height: 0; object-fit: contain; }
.private-card span { display: flex; justify-content: center; align-items: center; gap: 2px; min-height: 14px; background: var(--tc); color: #fff; font: 700 11px/1 system-ui, sans-serif; }
.private-card svg { width: 1em; height: 1em; }
#app #actionPanel #actions.private-peek-actions { display: flex; flex-direction: column; justify-content: center; }
#btnPrivatePeekConfirm { min-height: 40px; }
.peek-log { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }
#scorePanel .score-row.reward-option { outline: 2px dashed #ffe193; outline-offset: -3px; }
#scorePanel .score-row.reward-picked { outline: 3px solid #ffe193; }
.cpu-avatar-bubble { --cue-surface: #423525; --cue-depth: #211c15; position: fixed; z-index: 6000; display: flex; align-items: center; gap: 8px; box-sizing: border-box; max-width: calc(100vw - 16px); padding: 8px 12px; border: 2px solid var(--cue-player); border-radius: 12px; background: linear-gradient(145deg, var(--cue-surface), var(--cue-depth)); color: #ffe3a3; box-shadow: 0 4px 14px #0009, inset 0 1px #fff2; font: 700 14px/1.3 system-ui, sans-serif; pointer-events: none; transform-origin: var(--cue-pointer) -10px; }
.cpu-reward-hidden { visibility: hidden !important; }
.cpu-reward-card { border: 2px solid var(--tc); pointer-events: none; transform-origin: center; }
.cpu-avatar-bubble[hidden] { display: none; }
.cpu-avatar-bubble::before { content: ""; position: absolute; left: calc(var(--cue-pointer) - 5px); top: -7px; width: 10px; height: 10px; border-top: 2px solid var(--cue-player); border-left: 2px solid var(--cue-player); background: var(--cue-surface); transform: rotate(45deg); }
.cpu-reward-bubble .reward-icon { flex: none; width: 28px; height: 28px; }
.cpu-avatar-bubble > span { min-width: 0; overflow-wrap: anywhere; }
body:has(#modal:not([hidden])) .cpu-avatar-bubble, body:has(#tutorial:not([hidden])) .cpu-avatar-bubble { visibility: hidden; }
.cpu-thinking-bubble { --cue-surface: #244e40; --cue-depth: #142a23; }
html:is([data-appearance="expedition"], [data-appearance="frost"]) .cpu-thinking-bubble { --cue-surface: #f3e5c4; --cue-depth: #d7bc91; color: #412b19; }
.cpu-thinking-dots { display: inline-flex; gap: 3px; flex: none; }
.cpu-thinking-dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.cpu-thinking-bubble:not(.is-static) .cpu-thinking-dots i { animation: cpu-thinking-dot 1.15s ease-in-out var(--dot-delay, 0s) infinite; }
.cpu-thinking-dots i:nth-child(2) { --dot-delay: .14s; }
.cpu-thinking-dots i:nth-child(3) { --dot-delay: .28s; }
@keyframes cpu-thinking-dot { 0%, 65%, 100% { opacity: .55; } 32% { opacity: 1; transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) {
  .cpu-thinking-bubble:not(.is-static) .cpu-thinking-dots i { animation: none; }
}
@media (max-width: 500px) {
  .cpu-avatar-bubble { gap: 6px; padding: 6px 9px; font-size: 12px; }
  .cpu-reward-bubble .reward-icon { width: 24px; height: 24px; }
}
#actions .local-turn-controls { display: flex; flex: none; gap: 5px; }
#actions .local-turn-controls[hidden] { display: none; }
#actions .local-turn-controls .btn { min-height: 32px; padding: 4px 8px; font-size: 12px; }
#actions.turn-confirmation { justify-content: center; overflow-y: auto; }
.turn-confirmation-buttons { display: flex; flex: none; align-items: center; flex-wrap: wrap; gap: 8px; }
#app #actions #btnUndo { background: linear-gradient(135deg, #a14c40, #74342d); border-color: #b76e60; color: #fff1e5; text-shadow: 0 1px 1px #351410; box-shadow: inset 0 1px #f4bc9b55, 0 2px 4px #35141040; }
#app #actions #btnUndo:hover:not(:disabled) { background: linear-gradient(135deg, #b85b4c, #8b4035); border-color: #d3927e; color: #fff7ec; }
#app #actions #btnUndo:focus-visible { outline: 2px solid #e4a494; outline-offset: 2px; }
#app #actions #btnUndo:disabled { filter: none; opacity: .55; }
#dragPv .repave-segment { display: flex; flex: none; }
#places .repave-slot.reward-picked { outline: 2px dashed #ffe49a; outline-offset: -2px; border-radius: 6px; }
#pawns.repaving .pawn { transition: none !important; animation: none !important; }
#actions.reward-controls > .local-turn-controls { flex: none; }
.reward-setup[open] { display: flex; flex-direction: column; width: min(840px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 18px; gap: 10px; }
.reward-setup > h2, .reward-setup > p { flex: none; margin: 0; }
.reward-setup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; min-height: 0; overflow-y: auto; }
.reward-setup-option { display: grid; grid-template-columns: 38px minmax(0, 1fr); align-content: start; align-items: center; gap: 4px 8px; padding: 10px; border: 2px solid currentColor; border-radius: 8px; background: transparent; color: inherit; text-align: left; font: inherit; cursor: pointer; }
.reward-setup-option .reward-icon { width: 36px; height: 36px; }
.reward-setup-option > span { grid-column: 1 / -1; font-size: 12px; line-height: 1.5; }
.reward-setup-option[aria-pressed="true"] { background: #b18b4440; box-shadow: inset 0 0 0 2px currentColor; }
.reward-setup-option:disabled { opacity: .45; cursor: default; }
.reward-setup-option:focus-visible { outline: 3px solid #c89132; outline-offset: -5px; }
.reward-setup-actions { display: flex; flex: none; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.reward-setup-actions > span { margin-right: auto; }
.reward-setup-actions .btn { margin: 0; }
.reward-random { display: inline-flex; align-items: center; justify-content: center; }
.reward-random .reward-icon { width: 24px; height: 24px; }
@media (max-width: 500px) {
  .reward-setup[open] { padding: 12px; }
  .reward-setup-option { grid-template-columns: 28px minmax(0, 1fr); padding: 8px; font-size: 13px; }
  .reward-setup-option .reward-icon { width: 28px; height: 28px; }
  .reward-setup-actions .btn { padding: 6px 10px; font-size: 12px; }
}
.reward-footer { display: flex; flex: none; align-items: center; gap: 6px; }
.reward-rack__heading { display: flex; align-items: center; justify-content: space-between; gap: 2px; margin-bottom: 6px; color: #dec99e; font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.reward-rack__heading > span { white-space: nowrap; }
.reward-info { display: grid; place-items: center; flex: none; width: 24px; height: 24px; padding: 0; border: 2px solid #c9a24d; border-radius: 50%; background: #291f16; color: #ffe9b0; font: 800 13px/1 system-ui, sans-serif; cursor: pointer; }
.reward-info:hover { border-color: #ffe2a3; background: #463018; color: #fff0c1; }
.reward-rack__tokens { display: grid; gap: 6px; }
.reward-token { --reward-glow: #ffe091b8; --reward-ink: #fff3d4; position: relative; display: flex; align-items: center; gap: 4px; width: 100%; min-height: 48px; padding: 4px; border: 1px solid #bca064; border-radius: 8px; background: linear-gradient(146deg, #bfffe055 0%, transparent 34%), linear-gradient(168deg, #447c63, #285a47 54%, #38755b); color: var(--reward-ink); text-align: left; box-shadow: inset 0 1px #e6ffcb99, 0 2px 3px #0003; cursor: help; transition: border-color .2s, background .2s, box-shadow .2s; }
.reward-icon { display: block; flex: none; width: 34px; height: 34px; overflow: visible; }
img.reward-icon { object-fit: contain; }
.reward-token .reward-icon { width: 30px; height: 30px; }
.reward-wash { fill: currentColor; fill-opacity: .12; }
.reward-token__name { min-width: 0; font-size: 11px; line-height: 1.25; font-weight: 650; overflow-wrap: anywhere; }
.reward-token.ready { border-color: #fff0b8; background: linear-gradient(146deg, #cbffe161 0%, transparent 38%), linear-gradient(168deg, #508e70, #326751 54%, #488367); box-shadow: inset 0 0 0 1px #fff8cc, inset 0 0 9px #fff0b5, 0 0 8px var(--reward-glow); cursor: pointer; }
.reward-token.ready::after { content: ""; position: absolute; top: 5px; right: 5px; width: 5px; height: 5px; border-radius: 50%; background: #fff8d4; box-shadow: 0 0 0 1px #73561d, 0 0 6px var(--reward-glow); }
.reward-token.ready:not(.selected) { animation: reward-beacon 2.4s ease-in-out infinite; }
.reward-rack.is-static .reward-token { animation: none; }
.reward-token.selected { outline: 2px solid #ffdfa0; outline-offset: 2px; background: linear-gradient(146deg, #cbffe17a 0%, transparent 40%), linear-gradient(168deg, #58977a, #386e57 54%, #49876b); }
.reward-token:disabled { opacity: .38; filter: grayscale(.8); cursor: not-allowed; box-shadow: none; }
.reward-token:not(:disabled):hover { border-color: #ffe2a3; }
.reward-token:focus-visible, .reward-info:focus-visible { outline: 2px solid #fff0c1; outline-offset: 3px; }
html:is([data-appearance="expedition"], [data-appearance="frost"]) .reward-token { --reward-glow: #a45b1580; --reward-ink: #36261a; background: linear-gradient(145deg, #e4d1aa, #c0a376); border-color: #9c784a; }
html:is([data-appearance="expedition"], [data-appearance="frost"]) .reward-token.ready { background: linear-gradient(145deg, #fff4d5, #e0be82); border-color: #895319; }
html:is([data-appearance="expedition"], [data-appearance="frost"]) .reward-token.selected { background: linear-gradient(145deg, #fff6d8, #e9c98b); outline-color: #895319; }
html:is([data-appearance="expedition"], [data-appearance="frost"]) .reward-token:not(:disabled):hover { border-color: #62401f; }
#app #actionPanel.reward-phase { overflow: hidden; }
#app #actionPanel #actions.reward-controls { overflow: hidden; flex: 1 1 auto; gap: 4px; }
.reward-selection { display: flex; align-items: center; gap: 5px; color: inherit; font-size: 13px; font-weight: 700; }
.reward-selection > span { min-width: 0; }
.reward-selection .reward-icon { width: 26px; height: 26px; }
.reward-prompt, .reward-instruction { margin: 0; color: inherit; font-size: 12px; line-height: 1.25; }
#actions.reward-controls > .reward-selection, #actions.reward-controls > .btn-row { flex: none; }
#actions.reward-controls .reward-instruction { min-width: 0; }
#actions.reward-controls .reward-footer .btn { min-height: 32px; }
.reward-option { cursor: pointer; }
.reward-card-role { position: absolute; top: 4px; right: 4px; z-index: 3; padding: 2px 6px; border-radius: 4px; color: #201b12; background: #e6bb55; font-size: 12px; font-weight: bold; pointer-events: none; }
#hand .hcard.reward-option.reward-payment { outline: 3px solid #d87d70; outline-offset: -3px; }
.reward-payment .reward-card-role { color: #fff; background: #9c3d36; }
#hand .hcard.reward-option, .pm-card.reward-option, .reward-collection-card.reward-option { outline: 2px solid #e6bb55; outline-offset: -2px; filter: none; }
.promo.reward-option > .pc { outline: 3px solid #edc36a; outline-offset: 3px; cursor: pointer; }
.promo.reward-blocked > .pc { opacity: .5; cursor: not-allowed; }
.promo.reward-picked > .pc, #hand .hcard.reward-picked, .pm-card.reward-picked, .reward-collection-card.reward-picked { outline: 3px solid #fff0b0; outline-offset: 2px; box-shadow: 0 0 15px #f0bf63bb; }
.promo[data-reward-target]:focus-visible > .pc { outline: 3px dashed #fff0b0; outline-offset: 5px; }
#trackWrap.reward-selecting #places { z-index: 1100; }
.reward-prepend-space { flex: 0 0 auto; height: 1px; }
#trackWrap.reward-paving .pawn { transition: none; }
#places .reward-pave-slot.reward-picked { outline: 2px solid #fff0b0; outline-offset: -2px; border-radius: 6px; }
#places .reward-end-label { position: absolute; bottom: 3px; right: 3px; padding: 1px 3px; border-radius: 3px; background: #291a10e6; color: #fff3bd; font: 700 12px/1.3 system-ui, sans-serif; }
#trackWrap #dragPv[data-reward-promote] .dtag { width: max-content; box-sizing: border-box; white-space: normal; text-align: center; }
.reward-cell, .reward-landing { position: absolute; box-sizing: border-box; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 0; border: 3px dashed #ffe49a; border-radius: 7px; background: #eab64929; color: #fff3bd; pointer-events: auto; cursor: pointer; box-shadow: inset 0 0 10px #150c0988; }
.reward-cell > span { font: 900 clamp(20px, calc(var(--cell-w) * .34), 42px)/1 system-ui, sans-serif; text-shadow: 0 2px 3px #000; }
.reward-cell b { position: absolute; bottom: 3px; right: 4px; padding: 1px 3px; border-radius: 3px; background: #291a10e6; font: 700 12px/1.3 system-ui, sans-serif; }
.reward-cell .runner, .reward-landing .runner { width: max(24px, calc(var(--cell-w) * .32)); height: max(24px, calc(var(--cell-w) * .32)); }
.reward-cell:hover, .reward-cell:focus-visible { background: #f9d88066; outline: 2px solid #fff3c1; outline-offset: 2px; }
.reward-cell.reward-picked, .reward-landing { border-style: solid; background: #f4cb6570; box-shadow: inset 0 0 12px #fff3ba66, 0 0 10px #e6ba58; }
.reward-landing { pointer-events: none; cursor: default; }
#handArea { position: relative; }
#handArea.reward-source-open { overflow: visible !important; }
#rewardCollection { position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 1500; max-width: min(460px, 70vw); padding: 8px; border: 2px solid #c09b57; border-radius: 8px; background: #291e14; color: #f5dfb2; box-shadow: 0 3px 12px #0008; }
#rewardCollection[hidden], #rewardModes[hidden] { display: none; }
.reward-zone-title { margin-bottom: 5px; font-size: 12px; font-weight: 700; }
.reward-collection-row { display: flex; gap: 6px; overflow-x: auto; padding: 4px; max-width: 100%; }
.reward-collection-card { flex: none; width: clamp(52px, 7vw, 82px); padding: 0; overflow: hidden; border: 2px solid var(--tc, #ad9669); border-radius: 6px; background: #49361f; color: #fff3bd; cursor: pointer; }
.reward-collection-card img { display: block; width: 100%; }
.reward-collection-card .cap { display: flex; justify-content: center; align-items: center; gap: 3px; height: 18px; font-size: 12px; }
.reward-collection-card:disabled, .reward-mode:disabled { opacity: .4; cursor: not-allowed; }
#rewardModes { position: fixed; z-index: 2200; display: flex; gap: 6px; max-width: calc(100vw - 12px); padding: 6px; border: 2px solid #c09b57; border-radius: 7px; background: #291e14; color: #f5dfb2; box-shadow: 0 3px 12px #0008; }
.reward-mode { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 5px 8px; border: 1px solid #b39257; border-radius: 5px; background: #49361f; color: inherit; font: 12px/1.3 system-ui, sans-serif; cursor: pointer; }
.reward-mode b { font-size: 20px; }
.reward-mode.reward-picked { outline: 2px solid #fff0b0; outline-offset: 1px; }
.reward-mode:focus-visible, .reward-collection-card:focus-visible { outline: 3px solid #fff0b0; outline-offset: 2px; }
.reward-rule-title { display: flex; align-items: center; gap: 12px; }
.reward-rule-title .reward-icon { width: 44px; height: 44px; color: #bc934d; }
@keyframes reward-beacon { 50% { box-shadow: inset 0 0 0 2px #fff8cc, inset 0 0 14px #fff0b5, 0 0 15px var(--reward-glow); } }
@media (prefers-reduced-motion: reduce) { .reward-token.ready:not(.selected) { animation: none; } }
@media (orientation: portrait), (orientation: landscape) and (max-height: 500px) {
  .reward-rack { padding-top: 5px; margin-top: 3px; }
  .reward-rack__heading { justify-content: center; margin-bottom: 5px; letter-spacing: 0; }
  .reward-rack__heading > span { display: none; }
  .reward-rack__tokens { gap: 5px; }
  .reward-token { justify-content: center; gap: 0; min-height: 40px; padding: 3px 1px; border-radius: 6px; }
  .reward-token .reward-icon { width: 30px; height: 30px; }
  .reward-token__name { display: none; }
}
@media (orientation: landscape) and (max-height: 500px) {
  #actions.reward-controls .reward-selection .reward-icon { width: 20px; height: 20px; }
  #actions.reward-controls .reward-instruction { font-size: 11px; line-height: 1.15; }
  #actions.reward-controls > .btn-row, #actions.reward-controls .reward-footer {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; width: 100%;
  }
  #actions.reward-controls :is(.btn-row, .reward-footer) .btn { width: 100%; min-width: 0; min-height: 32px; padding: 2px; font-size: 11px; }
}
@media (orientation: portrait) {
  #actions.reward-controls > .local-turn-controls { grid-column: 1 / -1; grid-row: 4; }
  #actions.turn-confirmation { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; }
  #actions.turn-confirmation .panel-title { margin: 0; }
  #app #actionPanel #actions.reward-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: start; align-items: center; gap: 4px 8px; }
  #actions.reward-controls .reward-selection { grid-column: 1; grid-row: 1; font-size: 12px; }
  #actions.reward-controls .reward-selection .reward-icon { width: 22px; height: 22px; }
  #actions.reward-controls .reward-instruction { grid-column: 1; grid-row: 2; font-size: 12px; }
  #actions.reward-controls > .btn-row { grid-column: 2; grid-row: 1 / 4; flex-direction: column; }
  #actions.reward-controls .reward-footer { grid-column: 1; grid-row: 3; }
  #actions.reward-controls .reward-prompt { grid-column: 1 / -1; }
}

#rewardPanel[hidden] { display: none !important; }
#app #rewardPanel { box-sizing: border-box; width: clamp(58px, 5vw, 100px); max-width: 120px; padding: 6px; align-self: stretch; overflow: visible; }
#rewardPanel .reward-rack { margin: 0; padding: 0; border: 0; }
#rewardPanel .reward-rack__heading { justify-content: center; }
#rewardPanel .reward-rack__heading > span { display: none; }
#rewardPanel .reward-token { justify-content: center; }

@media (orientation: landscape) and (min-height: 501px) {
  #app #botRow:has(> #rewardPanel:not([hidden])) {
    --cw: min(calc(172 * var(--u)), calc((100vw - 2 * var(--edge) - 72px) / (var(--n, 3) * 1.06 + 6.17 + var(--act-x, 0))));
    --bp: calc(var(--cw) * .116); --bg: calc(var(--cw) * .06); --pg: calc(var(--cw) * .093);
    --btfs: max(13px, calc(var(--cw) * .13)); --card-w: var(--cw); --card-h: calc(var(--cw) / .7146); --cap-h: calc(var(--cw) * .15);
    --ppx: var(--bp); --ppy: var(--bp); --ptg: calc(var(--cw) * .07); --pfs: var(--btfs);
  }
  #app #botRow > #rewardPanel { flex: 1 1 60px !important; width: auto; min-width: 60px; container-type: inline-size; }
  #rewardPanel .reward-token__name { display: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  @container (min-width: 94px) {
    #rewardPanel .reward-token__name { display: block; }
  }
}

@media (orientation: portrait), (orientation: landscape) and (max-height: 500px) {
  #app #rewardPanel { width: 52px; padding: 4px; }
  #rewardPanel .reward-rack__heading { margin-bottom: 3px; }
  #rewardPanel .reward-info { width: 32px; height: 32px; }
  #rewardPanel .reward-rack__tokens { gap: 4px; }
  #rewardPanel .reward-token { min-height: 40px; padding: 2px 0; }
  #rewardPanel .reward-token .reward-icon { width: 26px; height: 26px; }
}
@media (orientation: portrait) {
  #app #actionPanel #actions:not(.mode-edit) > .panel-title {
    height: 30px !important; min-height: 30px !important; margin: 0 0 4px !important; padding-right: 36px !important;
    box-sizing: border-box; display: flex; align-items: center;
  }
  #app #actionPanel #actions .action-controls { flex: 0 0 auto; min-height: 32px; }
  #app #actionPanel #actions .local-turn-controls .btn { min-height: 40px; }
  #app #actionPanel #actions.reward-controls:has(.reward-prompt) > .reward-prompt { grid-column: 1 / -1; grid-row: 1; }
  #app #actionPanel #actions.reward-controls:has(.reward-prompt) > #btnSkipReward { grid-column: 2; grid-row: 2; }
  #app #actionPanel #actions.reward-controls:has(.reward-prompt) > .local-turn-controls { grid-column: 1; grid-row: 2; }
}
@media (orientation: landscape) and (max-height: 500px) {
  #app:has(#rewardPanel:not([hidden])) #botRow {
    --hand-in: calc(100vw - var(--sl) - var(--sr) - var(--act-w) - var(--pm-wid) - 3 * var(--gp) - 52px - 2 * var(--bp) - 4px);
    --reward-space: calc(100vw - var(--sl) - var(--sr) - var(--act-w) - 3 * var(--gp) - var(--hw) - var(--pm-wid));
    --reward-w: clamp(52px, var(--reward-space), 120px);
    --bx: max(0px, calc(var(--reward-space) - var(--reward-w)));
  }
  #app #rewardPanel { grid-area: hand; justify-self: start; align-self: end; width: var(--reward-w); height: var(--pnl-h); margin-left: calc(var(--bx) + var(--hw) + var(--pm-wid) + 2 * var(--gp)); container-type: inline-size; }
  #app:has(#rewardPanel:not([hidden])) #botRow > :is(#handArea, #publicMarket) { transition: none; }
  #rewardPanel .reward-rack { height: 100%; display: flex; flex-direction: column; }
  #rewardPanel .reward-rack__heading { flex: 1 1 0; min-height: 0; margin-bottom: 2px; }
  #rewardPanel .reward-info { width: min(32px, calc((var(--pnl-h) - 18px) / 4)); height: min(32px, calc((var(--pnl-h) - 18px) / 4)); }
  #rewardPanel .reward-rack__tokens { flex: 3 1 0; min-height: 0; grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 2px; }
  #rewardPanel .reward-token { min-height: 0; }
  #rewardPanel .reward-token .reward-icon { width: min(26px, calc((var(--pnl-h) - 24px) / 4)); height: min(26px, calc((var(--pnl-h) - 24px) / 4)); }
  @container (min-width: 95px) {
    #rewardPanel .reward-token__name { display: block; white-space: nowrap; }
  }
}
@media (orientation: landscape) and (max-height: 360px) {
  #rewardPanel .reward-rack__tokens { gap: 2px; }
  #rewardPanel .reward-token .reward-icon { width: 20px; height: 20px; }
}
@media (orientation: portrait) and (min-width: 501px) {
  #app:has(#rewardPanel:not([hidden])) {
    --act-w: calc(100vw - var(--sl) - var(--sr) - 2 * var(--gp) - var(--pm-wid) - 52px);
    grid-template-columns: var(--pop-w) minmax(0, 1fr) 52px var(--act-w);
    grid-template-areas: "top top top top" "pop market market market" "hand hand hand hand" "pm pm rew act";
  }
  #app.has-portfolio:has(#rewardPanel:not([hidden])) {
    grid-template-columns: var(--pop-w) var(--pf-w) minmax(0, 1fr) 52px var(--act-w);
    grid-template-areas: "top top top top top" "pop pf market market market" "hand hand hand hand hand" "pm pm pm rew act";
  }
  #app #rewardPanel { grid-area: rew; height: var(--pnl-h); }
}
@media (orientation: portrait) and (max-width: 500px) {
  #app:has(#rewardPanel:not([hidden])), #app.has-portfolio:has(#rewardPanel:not([hidden])) {
    --phone-reward-w: clamp(52px, calc(100vw - var(--sl) - var(--sr) - var(--gp) - 4 * var(--cw) - 3 * 4px - 2 * var(--bp) - 4px), 120px);
    grid-template-columns: var(--pop-w) minmax(0, 1fr) var(--phone-reward-w);
    grid-template-areas: "top top top" "pop market market" "hand hand hand" "pm pm rew" "act act act";
  }
  #app #rewardPanel { grid-area: rew; width: 100%; height: var(--phone-panel-h); }
  #rewardPanel .reward-rack__tokens { gap: 2px; }
  #rewardPanel .reward-token { min-height: 32px; padding: 0; }
  #rewardPanel .reward-token .reward-icon { width: 30px; height: 30px; }
}
@media (orientation: portrait) and (min-width: 360px) and (max-width: 500px) {
  #rewardPanel .reward-token { gap: 3px; }
  #rewardPanel .reward-token__name { display: block; }
}
