#game-ui {
  width: 100%; height: var(--app-height, 100dvh); max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  font-size: 14px; background: #192f46;
}
.top-panel, .action-panel { background: #25445f; padding: 12px; }
.top-panel { border-bottom: 3px solid #112b40; }
.title-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.brand { font-size: 15px; font-weight: 800; letter-spacing: .06em; }
.brand span { font-size: 11px; color: #c6e4f4; font-weight: 400; letter-spacing: 0; }
[data-money] { font-size: 18px; color: #ffe27d; white-space: nowrap; }
.resources { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.resources > div { display: grid; gap: 3px; padding: 7px 8px; background: #192f46; border-radius: 9px; }
.resources span { font-size: 11px; color: #c9e4f5; }
.resources strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.field-zone { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #1a1d21; }
[data-field-slot] { position: absolute; inset: 0; }
.field-hint { position: absolute; bottom: 8px; left: 8px; padding: 4px 7px; color: #d0e8f5; font-size: 11px; background: #192f46dc; border-radius: 6px; pointer-events: none; }
.notice { position: absolute; top: 8px; left: 12px; right: 12px; margin: 0; text-align: center; color: #ffe1cb; background: #603526ee; border-radius: 10px; pointer-events: none; }
.notice:not(:empty) { padding: 10px; }
.action-panel { border-top: 3px solid #112b40; }
.save-warning { margin: 0 0 8px; color: #ffe49a; font-size: 12px; line-height: 1.4; }
.action-hint { margin: 0 0 10px; color: #d0e8f5; font-size: 12px; }
.actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
button { min-height: 44px; min-width: 44px; border: 1px solid #5292b8; border-bottom: 4px solid #153146; border-radius: 12px; padding: 10px; background: #366384; color: #f4f5f7; font: 600 14px system-ui, sans-serif; cursor: pointer; touch-action: manipulation; transition: background .12s, transform .12s; }
button small { display: block; font-size: 10px; margin-top: 4px; font-weight: 400; }
button:active { transform: scale(.97); background: #477d9d; }
button:focus-visible { outline: 3px solid #ffb27e; outline-offset: 2px; }
button.primary { background: #ffd15b; border-color: #e3aa35; border-bottom-color: #bd7b29; color: #3d2b17; }
button[aria-disabled="true"] { color: #c8d2dd; background: #3b5062; border-color: #5d7385; }
button[aria-pressed="true"] { border-color: #ffd15b; }
.placement-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; border-left: 4px solid #ffd15b; padding-left: 10px; }
.placement-bar p { margin: 0; line-height: 1.4; flex: 1; }
.panel-dialog { position: fixed; inset: 0; margin: 0; padding: 0; width: 100%; max-width: none; height: var(--app-height, 100dvh); max-height: none; border: 0; color: #f4f5f7; background: transparent; overscroll-behavior: contain; }
.panel-dialog[open] { display: flex; align-items: flex-end; justify-content: center; }
.panel-dialog::backdrop { background: #000a; }
.bottom-sheet { display: flex; flex-direction: column; width: 100%; max-width: 640px; max-height: calc(100% - var(--safe-top) - 24px); background: #25445f; border: 2px solid #5b87a3; border-bottom: 0; border-radius: 20px 20px 0 0; padding: 16px max(16px, var(--safe-right)) max(16px, var(--safe-bottom)) max(16px, var(--safe-left)); }
.sheet-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
h1 { font-size: 21px; margin: 0; }
.sheet-scroll { overflow-y: auto; overscroll-behavior: contain; min-height: 0; padding-top: 8px; }
.sheet-intro { font-size: 13px; color: #d4e9f5; line-height: 1.6; }
.machine-card { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 10px; background: #1a354d; border: 2px solid #416e8b; border-radius: 16px; padding: 14px; margin: 12px 0; }
.machine-icon { width: 80px; height: 80px; object-fit: contain; align-self: center; }
.machine-card h2 { font-size: 17px; margin: 0 0 7px; }
.machine-card p { margin: 0 0 5px; line-height: 1.5; font-size: 13px; }
.machine-card small { font-size: 12px; color: #b8d3e3; }
.machine-card button, .machine-card .buy-reason { grid-column: 1 / -1; }
.machine-card .buy-reason { margin: 0; color: #ffe49a; font-size: 12px; }
@media (max-width: 360px) { .brand span { display: none; } button { font-size: 12px; padding: 9px 5px; } .top-panel, .action-panel { padding: 9px; } }
@media (max-height: 500px) { .top-panel, .action-panel { padding: 6px 12px; } .title-row { margin-bottom: 4px; } .resources > div { padding: 4px 8px; } .action-hint { display: none; } .placement-bar { margin-bottom: 5px; } .actions button small { display: none; } }
@media (prefers-reduced-motion: reduce) { button { transition: none; } button:active { transform: none; } }

.placement-bar { background: #19364b; border-radius: 12px; padding: 8px; }
.placement-bar img, .selected-card img { object-fit: contain; flex: 0 0 auto; }
.placement-bar p { font-weight: 600; font-size: 13px; }
.selected-card { display: flex; gap: 10px; align-items: center; padding: 8px; margin-bottom: 10px; background: #19364b; border-radius: 14px; }
.selected-card > div { flex: 1; min-width: 0; }
.selected-card p { color: #98ffc5; margin: 4px 0; font-weight: 700; }
.selected-card small { font-size: 11px; color: #c4dce9; }
