
/* WebView / mobile preview overrides */
@media (max-width: 900px) and (orientation: landscape) {
  body {
    overflow-y: auto;
  }

  body.game-active {
    overflow: hidden;
  }

  .build-badge {
    top: 6px;
    right: 6px;
    padding: 6px 9px;
    font-size: 9px;
  }

  .start-screen {
    min-height: 100vh;
    padding: 8px;
    place-items: center;
  }

  .hero-card {
    width: min(100%, 980px);
    max-height: calc(100vh - 16px);
    overflow: auto;
    padding: 12px;
    border-radius: 20px;
    position: relative;
  }

  .hero-headline-row {
    gap: 6px;
    padding-right: 186px;
  }

  .hero-kicker,
  .hero-status-pills span,
  .table-chip {
    font-size: 9px;
    padding: 5px 8px;
  }

  .hero-status-pills,
  .table-chip-row {
    gap: 6px;
  }

  .hero-main {
    display: block;
    margin-top: 6px;
  }

  .hero-copy {
    padding-right: 190px;
  }

  .hero-icon {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    font-size: 26px;
    margin-bottom: 4px;
  }

  .hero-copy h1 {
    font-size: clamp(24px, 5.4vw, 40px);
    margin: 2px 0 4px;
  }

  .hero-copy p {
    font-size: 10px;
    line-height: 1.28;
    max-width: none;
  }

  .hero-tags {
    gap: 4px;
    margin-top: 5px;
  }

  .hero-tags span {
    padding: 3px 6px;
    font-size: 8px;
  }

  .hero-feature-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    margin-top: 7px;
  }

  .hero-feature-card {
    padding: 6px;
    border-radius: 10px;
  }

  .hero-feature-card strong {
    font-size: 10px;
    margin-bottom: 2px;
  }

  .hero-feature-card span {
    font-size: 8px;
    line-height: 1.2;
  }

  .hero-showcase {
    position: absolute;
    top: 46px;
    right: 12px;
    width: 168px;
    min-height: 116px;
    height: 116px;
    border-radius: 16px;
  }

  .showcase-orbit {
    inset: 24px;
  }

  .showcase-card {
    font-size: 8px;
    line-height: 1.1;
    padding-top: 4px;
  }

  .showcase-chip {
    font-size: 8px;
    padding: 5px 8px;
  }

  .showcase-dice,
  .showcase-token {
    transform: scale(.66);
    transform-origin: center;
  }

  .start-config-panel {
    margin-top: 6px;
    gap: 5px;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .config-section {
    padding: 5px 6px;
    border-radius: 10px;
  }

  .config-section-head {
    gap: 1px;
    margin-bottom: 2px;
  }

  .config-section-head strong {
    font-size: 10px;
  }

  .config-section-head span,
  .player-select label,
  .player-select span {
    font-size: 8px;
  }

  .config-section-head span {
    display: none;
  }

  .player-select {
    gap: 3px;
    margin: 2px auto 0;
    padding: 0;
    border-radius: 0;
    justify-content: flex-start;
    background: transparent;
    box-shadow: none;
  }

  .player-select label {
    padding: 2px 5px;
    gap: 3px;
    border-radius: 999px;
    background: #ffffffee;
    box-shadow: none;
    border: 1px solid #dbe4f0;
    min-height: 22px;
  }

  .mode-select,
  .speed-select,
  .difficulty-select {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .count-section .player-select,
  .ai-section .player-select {
    display: flex;
    flex-wrap: wrap;
  }

  .hero-actions {
    gap: 6px;
    margin-top: 2px;
    grid-column: 1 / -1;
  }

  .hero-actions button {
    font-size: 11px;
    padding: 6px 9px;
    border-radius: 10px;
  }

  .game-screen {
    width: 100vw;
    height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 236px;
    gap: 6px;
    padding: 6px;
    overflow: hidden;
  }

  .mobile-tip {
    display: none;
  }

  .table-surface {
    padding: 6px;
    border-radius: 18px;
  }

  .title-row {
    display: none;
  }

  .board-wrap {
    width: min(calc(100vh - 18px), calc(100vw - 254px));
    max-width: min(calc(100vh - 18px), calc(100vw - 254px));
    padding: 14px;
  }

  .district-ribbon {
    display: none;
  }

  .board-wrap::after {
    display: none;
  }

  .right-panel {
    max-height: calc(100vh - 12px);
    overflow-y: auto;
    gap: 5px;
  }

  .right-panel-shell,
  .hud-grid {
    gap: 6px;
  }

  .card {
    padding: 7px;
    border-radius: 12px;
  }

  .card-topline,
  .battle-card,
  .data-tabs {
    display: none;
  }

  .card h2 {
    font-size: 14px;
    margin-bottom: 6px;
  }

  .current-player {
    font-size: 12px;
    padding: 6px 7px;
    margin-bottom: 5px;
  }

  #rollButton {
    min-height: 38px;
    font-size: 14px;
    padding: 9px 10px;
  }

  #diceResult {
    font-size: 12px;
    min-height: 18px;
  }

  .player-status-sub {
    display: none;
  }
}

@media (max-width: 520px) and (orientation: portrait) {
  body.game-active {
    overflow-y: auto;
  }

  .build-badge {
    top: 8px;
    right: 8px;
    padding: 6px 9px;
    font-size: 9px;
  }

  .start-screen {
    min-height: 100vh;
    padding: 10px;
    place-items: start center;
  }

  .hero-card {
    width: min(100%, 460px);
    padding: 12px;
    border-radius: 20px;
  }

  .hero-headline-row {
    gap: 8px;
  }

  .hero-status-pills {
    gap: 6px;
    flex-wrap: wrap;
  }

  .hero-status-pills span,
  .hero-kicker,
  .hero-tags span {
    font-size: 10px;
  }

  .hero-main {
    display: block;
    margin-top: 8px;
  }

  .hero-showcase {
    position: relative;
    top: auto;
    right: auto;
    width: 100%;
    height: 160px;
    min-height: 160px;
    margin-top: 10px;
  }

  .hero-copy h1 {
    font-size: 28px;
    line-height: 1.1;
  }

  .hero-copy p {
    font-size: 13px;
    line-height: 1.5;
  }

  .hero-feature-strip {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .start-config-panel {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 10px;
  }

  .config-section {
    padding: 10px;
    border-radius: 14px;
  }

  .config-section-head strong {
    font-size: 14px;
  }

  .config-section-head span,
  .player-select label,
  .player-select span {
    font-size: 12px;
  }

  .player-select {
    gap: 6px;
    flex-wrap: wrap;
  }

  .player-select label {
    min-height: 34px;
  }

  .mode-select,
  .speed-select,
  .difficulty-select {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-actions {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .hero-actions button {
    min-height: 44px;
    font-size: 14px;
  }

  .game-screen {
    width: 100vw;
    min-height: 100vh;
    height: auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px;
    overflow: visible;
  }

  .mobile-tip {
    display: block;
    order: -2;
    padding: 10px 12px;
    border-radius: 14px;
    background: linear-gradient(135deg, #fef3c7, #fff7ed);
    color: #92400e;
    font-size: 13px;
    font-weight: 900;
    text-align: center;
  }

  .title-row {
    display: none;
  }

  .table-surface {
    padding: 8px;
    border-radius: 18px;
  }

  .board-wrap {
    width: min(100%, 440px);
    max-width: min(100%, calc(100vh - 96px));
    padding: 14px;
  }

  .district-ribbon,
  .board-wrap::after {
    display: none;
  }

  .tile-name {
    font-size: 10px;
  }

  .tile-info {
    font-size: 7px;
  }

  .tile-icon {
    width: 16px;
    height: 16px;
    font-size: 10px;
  }

  .right-panel {
    max-height: none;
    overflow: visible;
  }

  .battle-card,
  .data-tabs {
    display: none;
  }
}
