/* 青城大富翁 — 柔和青绿轻盈风格 */

:root {
  --bg: #e4ebe3;
  --bg-deep: #d5dfd4;
  --surface: #f7f8f5;
  --surface-2: #ffffff;
  --ink: #2a322c;
  --ink-soft: #5c6a60;
  --muted: #8a968c;
  --line: rgba(42, 50, 44, 0.08);
  --green: #3d6b5a;
  --green-soft: #5a8f6e;
  --green-bg: #e8f0ea;
  --gold: #e4b04a;
  --gold-ink: #5a4010;
  --danger: #c45c5c;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 8px 28px rgba(45, 60, 48, 0.08);
  --shadow-sm: 0 2px 10px rgba(45, 60, 48, 0.06);
  --font: "Outfit", "Noto Sans SC", system-ui, sans-serif;
  --font-display: "Fraunces", "Noto Serif SC", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(255, 255, 255, 0.55), transparent 50%),
    radial-gradient(ellipse 70% 50% at 90% 80%, rgba(90, 143, 110, 0.12), transparent 45%),
    linear-gradient(160deg, #e8eee6 0%, #dce6dc 45%, #e2e8df 100%);
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.app {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 280px;
  gap: 18px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px;
  min-height: 100vh;
}

/* ——— Left: players ——— */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.brand {
  padding: 8px 4px 4px;
}

.brand-mark {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--green);
  line-height: 1.2;
}

.brand-sub {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.player-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.player-card {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 2px solid transparent;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.player-card.active {
  border-color: var(--pc, var(--green));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc, var(--green)) 22%, transparent),
    var(--shadow);
  transform: translateX(2px);
}

.player-card.bankrupt {
  opacity: 0.45;
  filter: grayscale(0.4);
}

.player-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--green-bg);
  display: grid;
  place-items: center;
  font-size: 1.45rem;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--pc, var(--green)) 35%, transparent);
}

.player-name {
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.you-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
}

.player-cash {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--green);
  margin-top: 2px;
}

.player-net {
  font-size: 0.72rem;
  color: var(--muted);
}

.player-status {
  font-size: 0.72rem;
  color: var(--ink-soft);
  margin-top: 2px;
}

.turn-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--green);
  background: var(--green-bg);
  padding: 3px 8px;
  border-radius: 999px;
}

.legend {
  margin-top: auto;
  padding: 12px;
  background: rgba(255, 255, 255, 0.45);
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  color: var(--ink-soft);
}

.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

/* ——— Center board ——— */
.main {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.board-wrap {
  position: relative;
  flex: 1;
  background: var(--surface);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 16px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.board-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 40%, rgba(90, 143, 110, 0.06), transparent 40%),
    radial-gradient(circle at 70% 60%, rgba(228, 176, 74, 0.05), transparent 35%);
  pointer-events: none;
}

.board {
  position: relative;
  width: min(100%, 720px);
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(7, 1fr);
  gap: 6px;
  z-index: 1;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  padding: 6px 4px 4px;
  background: #fbfcf9;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  min-height: 0;
  overflow: hidden;
  color: inherit;
}

.tile:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  z-index: 2;
}

.tile.selected {
  border-color: var(--green-soft);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--green-soft) 35%, transparent);
  z-index: 3;
}

.tile.owned {
  box-shadow: inset 0 -3px 0 var(--owner, transparent);
}

.tile-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--group, transparent);
  border-radius: 12px 12px 0 0;
}

.tile-icon {
  font-size: 1rem;
  line-height: 1;
  margin-top: 6px;
}

.tile-name {
  font-size: 0.58rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
  color: var(--ink);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-price {
  font-size: 0.55rem;
  color: var(--muted);
  font-weight: 500;
}

.tile-tokens {
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: -4px;
}

.token {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  border: 2px solid #fff;
  margin-left: -4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  animation: pop-in 0.3s ease;
}

@keyframes pop-in {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.tile-start {
  background: linear-gradient(160deg, #eef5ef, #fbfcf9);
}
.tile-luck {
  background: linear-gradient(160deg, #fdf6e8, #fbfcf9);
}
.tile-tax {
  background: linear-gradient(160deg, #f8eeee, #fbfcf9);
}
.tile-workshop {
  background: linear-gradient(160deg, #eef2f6, #fbfcf9);
}

/* Center hub */
.board-center {
  grid-column: 2 / 7;
  grid-row: 2 / 7;
  background: linear-gradient(155deg, #3a6354 0%, #2f5246 55%, #27453b 100%);
  border-radius: 22px;
  color: #f2f6f3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 12px 32px rgba(30, 50, 40, 0.25);
  overflow: hidden;
}

.board-center::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.08), transparent 55%);
  pointer-events: none;
}

.round-pill {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.die {
  width: 72px;
  height: 72px;
  background: linear-gradient(145deg, #fffef8, #f0e6d0);
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--ink);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.25),
    inset 0 2px 0 rgba(255, 255, 255, 0.8);
  margin-top: 18px;
  transition: transform 0.15s;
}

.die.rolling {
  animation: shake 0.12s infinite;
}

@keyframes shake {
  0%,
  100% {
    transform: rotate(-6deg) scale(1.02);
  }
  50% {
    transform: rotate(6deg) scale(0.98);
  }
}

.action-panel {
  text-align: center;
  z-index: 1;
  max-width: 280px;
}

.action-msg {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.35;
}

.action-sub {
  margin: 6px 0 14px;
  font-size: 0.85rem;
  opacity: 0.75;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 28px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn-gold {
  background: linear-gradient(180deg, #f0c35a, #e4b04a);
  color: var(--gold-ink);
  box-shadow: 0 6px 16px rgba(228, 176, 74, 0.35);
}

.btn-ghost {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 8px;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 6px;
}

.btn-soft {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
}

.picker button {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.8rem;
}

.picker p {
  width: 100%;
  margin: 0 0 4px;
  font-size: 0.8rem;
  opacity: 0.8;
}

/* ——— Right panel ——— */
.panel {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
}

.panel h2 {
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}

.market-card .market-label {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--green);
  margin: 0;
}

.market-card .market-desc {
  margin: 2px 0 10px;
  font-size: 0.75rem;
  color: var(--muted);
}

.market-chart {
  width: 100%;
  height: 48px;
  display: block;
}

.prop-head {
  display: flex;
  gap: 12px;
  align-items: center;
}

.prop-icon {
  font-size: 1.6rem;
}

.prop-swatch {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.prop-head h3 {
  margin: 0;
  font-size: 1rem;
}

.muted {
  color: var(--muted);
  font-size: 0.78rem;
  margin: 0;
}

.prop-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0 0;
}

.prop-stats div {
  background: var(--green-bg);
  border-radius: 12px;
  padding: 10px 12px;
}

.prop-stats dt {
  font-size: 0.7rem;
  color: var(--muted);
  margin: 0;
}

.prop-stats dd {
  margin: 4px 0 0;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--green);
}

.inventory {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.inv-slot {
  aspect-ratio: 1;
  border-radius: 14px;
  border: 1.5px dashed rgba(90, 143, 110, 0.25);
  background: rgba(232, 240, 234, 0.45);
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  transition: transform 0.15s, border-color 0.15s;
}

.inv-slot.filled {
  border-style: solid;
  border-color: rgba(90, 143, 110, 0.35);
  background: #fff;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.inv-slot.filled:hover {
  transform: scale(1.06);
  border-color: var(--green);
}

.log-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-feed li {
  font-size: 0.78rem;
  color: var(--ink-soft);
  line-height: 1.4;
  padding-left: 10px;
  border-left: 2px solid var(--green-soft);
}

.session-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.btn-outline {
  width: 100%;
  padding: 11px;
  border-radius: 999px;
  border: 1.5px solid var(--green);
  color: var(--green);
  font-weight: 650;
  font-size: 0.88rem;
  background: rgba(255, 255, 255, 0.6);
}

.btn-outline:hover {
  background: var(--green-bg);
}

.btn-text {
  font-size: 0.78rem;
  color: var(--muted);
  padding: 4px;
}

.save-meta {
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
}

#save-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--green);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  z-index: 100;
}

/* Game over */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 40, 34, 0.45);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  z-index: 50;
  padding: 20px;
}

.overlay[hidden] {
  display: none !important;
}

.overlay-card {
  background: var(--surface-2);
  border-radius: 24px;
  padding: 32px;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow);
  text-align: center;
  animation: pop-in 0.35s ease;
}

.overlay-card h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin: 0 0 8px;
  color: var(--green);
}

.overlay-card > p {
  color: var(--muted);
  margin: 0 0 20px;
}

#go-list {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  text-align: left;
}

#go-list li {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 6px;
  background: var(--green-bg);
  font-size: 0.9rem;
}

#go-list li:first-child {
  background: linear-gradient(90deg, #f0e0a8, #e8f0ea);
  font-weight: 700;
}

.aside {
  min-height: 0;
}

.aside .panel {
  flex-shrink: 0;
}

.panel-log {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.prop-spotlight {
  display: none;
}

.mobile-tabs {
  display: none;
}

/* ——— Tablet ——— */
@media (max-width: 1100px) {
  .app {
    grid-template-columns: 200px minmax(0, 1fr) 240px;
    gap: 12px;
    padding: 12px;
  }
  .tile-name {
    font-size: 0.5rem;
  }
}

/* ——— Mobile / narrow ——— */
@media (max-width: 860px) {
  html,
  body {
    min-height: 100dvh;
    overscroll-behavior: none;
  }

  body {
    padding-bottom: calc(128px + env(safe-area-inset-bottom, 0px));
  }

  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 8px;
    padding: 8px 10px 0;
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
    max-width: none;
    min-height: auto;
  }

  .sidebar {
    order: 1;
    gap: 6px;
  }

  .main {
    order: 2;
    gap: 10px;
  }

  .aside {
    order: 3;
    gap: 8px;
    padding-bottom: 8px;
  }

  .brand {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 0 2px;
  }

  .brand-mark {
    font-size: 1.1rem;
  }

  .brand-sub {
    margin: 0;
    font-size: 0.65rem;
    white-space: nowrap;
  }

  .legend {
    display: none;
  }

  .player-list {
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 2px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .player-list::-webkit-scrollbar {
    display: none;
  }

  .player-card {
    min-width: 124px;
    max-width: 140px;
    flex: 0 0 auto;
    padding: 8px;
    gap: 6px;
    scroll-snap-align: start;
    border-radius: 14px;
  }

  .player-card.active {
    transform: none;
  }

  .player-avatar {
    width: 34px;
    height: 34px;
    font-size: 1.05rem;
  }

  .player-name {
    font-size: 0.75rem;
  }

  .player-cash {
    font-size: 0.75rem;
  }

  .player-net {
    display: none;
  }

  .player-status {
    font-size: 0.6rem;
  }

  .turn-badge {
    top: 5px;
    right: 5px;
    font-size: 0.55rem;
    padding: 2px 5px;
  }

  /* 棋盘缩小，给地产详情留空间 */
  .board-wrap {
    padding: 6px;
    border-radius: 16px;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    flex: 0 0 auto;
  }

  .board {
    width: min(68vw, 280px);
    max-width: 100%;
    gap: 2px;
  }

  .tile {
    padding: 2px 1px 1px;
    border-radius: 6px;
  }

  .tile:hover {
    transform: none;
  }

  .tile-bar {
    height: 3px;
    border-radius: 6px 6px 0 0;
  }

  .tile-icon {
    font-size: 0.62rem;
    margin-top: 2px;
  }

  .tile-name {
    font-size: 0;
  }

  .tile-price {
    font-size: 0;
  }

  .token {
    width: 12px;
    height: 12px;
    font-size: 0.45rem;
    border-width: 1px;
  }

  .board-center {
    border-radius: 12px;
    gap: 4px;
    padding: 6px;
    justify-content: center;
  }

  .round-pill {
    top: 6px;
    padding: 3px 8px;
    font-size: 0.58rem;
  }

  .die {
    width: 36px;
    height: 36px;
    font-size: 1.15rem;
    border-radius: 10px;
    margin-top: 16px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  }

  /* 地产详情放大、始终显示在棋盘下方 */
  .prop-spotlight {
    display: block;
    padding: 16px 16px 14px;
    border-radius: 18px;
    box-shadow: var(--shadow);
    background: var(--surface-2);
    border: 1.5px solid color-mix(in srgb, var(--green) 18%, transparent);
  }

  .prop-spotlight h2 {
    margin: 0 0 12px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--green);
    letter-spacing: 0.06em;
  }

  .prop-spotlight .prop-head {
    gap: 14px;
    align-items: center;
  }

  .prop-spotlight .prop-swatch {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    font-size: 1.7rem;
  }

  .prop-spotlight .prop-icon {
    font-size: 2.2rem;
  }

  .prop-spotlight .prop-head h3 {
    font-size: 1.35rem;
    line-height: 1.25;
  }

  .prop-spotlight .muted {
    font-size: 0.88rem;
    margin-top: 2px;
  }

  .prop-spotlight .prop-stats {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 16px;
  }

  .prop-spotlight .prop-stats div {
    padding: 14px 14px;
    border-radius: 14px;
  }

  .prop-spotlight .prop-stats dt {
    font-size: 0.78rem;
  }

  .prop-spotlight .prop-stats dd {
    font-size: 1.25rem;
    margin-top: 6px;
  }

  .panel-prop-desktop {
    display: none !important;
  }

  /* 操作区固定到底部 */
  .action-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    max-width: none;
    margin: 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, #3a6354 0%, #2a4a3f 100%);
    color: #f2f6f3;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -10px 32px rgba(30, 50, 40, 0.28);
    text-align: center;
  }

  .action-msg {
    font-size: 0.95rem;
  }

  .action-sub {
    margin: 4px 0 10px;
    font-size: 0.78rem;
  }

  .btn {
    min-height: 46px;
    padding: 12px 22px;
    font-size: 0.95rem;
    width: min(100%, 320px);
  }

  .btn-ghost {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    width: min(100%, 320px);
    margin-top: 4px;
  }

  .btn-soft {
    width: min(100%, 320px);
  }

  .picker {
    gap: 6px;
  }

  .picker button {
    min-width: 44px;
    min-height: 44px;
    font-size: 0.95rem;
  }

  .mobile-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    background: var(--surface);
    border-radius: 14px;
    padding: 6px;
    box-shadow: var(--shadow-sm);
  }

  .mobile-tab {
    border-radius: 10px;
    padding: 10px 4px;
    font-size: 0.78rem;
    font-weight: 650;
    color: var(--ink-soft);
    background: transparent;
    min-height: 40px;
  }

  .mobile-tab.active {
    background: var(--green-bg);
    color: var(--green);
  }

  .aside .panel {
    display: none;
  }

  .aside .panel.is-active {
    display: block;
  }

  .aside .panel-log.is-active {
    display: flex;
  }

  .aside .panel h2 {
    display: none;
  }

  .log-feed {
    max-height: 140px;
  }

  .inventory {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .inv-slot {
    min-height: 56px;
  }

  .session-actions {
    margin-top: 4px;
  }

  .btn-outline {
    min-height: 44px;
  }

  .overlay {
    padding: 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .overlay-card {
    padding: 24px 18px;
    border-radius: 20px;
    max-height: min(90dvh, 560px);
    overflow: auto;
  }

  #save-toast {
    bottom: calc(140px + env(safe-area-inset-bottom, 0px));
  }
}

/* 超小屏 */
@media (max-width: 400px) {
  .board {
    width: min(64vw, 240px);
  }

  .brand-sub {
    display: none;
  }

  .player-card {
    min-width: 112px;
  }

  .prop-spotlight .prop-head h3 {
    font-size: 1.2rem;
  }

  .prop-spotlight .prop-stats dd {
    font-size: 1.12rem;
  }
}

/* 横屏手机 */
@media (max-width: 860px) and (orientation: landscape) and (max-height: 500px) {
  body {
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  }

  .app {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 8px;
  }

  .sidebar {
    grid-column: 1 / -1;
    order: 1;
  }

  .main {
    order: 2;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 10px;
  }

  .board-wrap {
    margin: 0;
  }

  .board {
    width: min(42vh, 220px);
  }

  .prop-spotlight {
    flex: 1;
    min-width: 0;
    align-self: stretch;
  }

  .aside {
    order: 3;
    grid-column: 1 / -1;
    max-height: none;
  }

  .action-panel {
    padding-top: 8px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .action-sub {
    display: none;
  }

  .die {
    width: 32px;
    height: 32px;
    font-size: 1rem;
    margin-top: 14px;
  }
}
