/* =============================================
   Monopoly · World Tour UI
   Phase 1: board, HUD, property cards and responsive layout.
   Game rules and state are kept in game.js.
   ============================================= */

:root {
  --ink: #172033;
  --ink-deep: #0d1424;
  --panel: rgba(25, 35, 56, 0.94);
  --panel-soft: rgba(255, 255, 255, 0.08);
  --cream: #fff8e9;
  --muted: rgba(255, 248, 233, 0.64);
  --gold: #f4c96b;
  --wood: #ad6d35;
  --wood-dark: #57331f;
  --line: rgba(255, 231, 177, 0.22);
  --shadow: 0 22px 60px rgba(3, 8, 18, 0.38);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  outline: transparent;
}

html,
body {
  width: 100%;
  min-height: 100vh;
  color: var(--cream);
  background:
    radial-gradient(circle at 15% 0%, rgba(68, 117, 137, 0.42), transparent 32rem),
    radial-gradient(circle at 100% 48%, rgba(151, 76, 58, 0.3), transparent 34rem),
    linear-gradient(135deg, #0b1221, #1a2940 50%, #111827);
  font-size: 14px;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: 0.22;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

li {
  list-style: none;
}

button,
select {
  font: inherit;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
}

::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(244, 201, 107, 0.4);
}

/* =============================================
   Setup panel
   ============================================= */

.option-panel {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 10, 20, 0.8);
  backdrop-filter: blur(12px);
}

.option-panel.hidden {
  display: none;
}

.option-content {
  position: relative;
  width: min(560px, 100%);
  padding: 42px 46px;
  overflow: hidden;
  text-align: center;
  border: 1px solid rgba(244, 201, 107, 0.35);
  border-radius: 26px;
  background:
    radial-gradient(circle at 90% 0%, rgba(244, 201, 107, 0.2), transparent 18rem),
    linear-gradient(145deg, #263b55, #141e32 70%);
  box-shadow: var(--shadow), 0 0 0 8px rgba(255, 255, 255, 0.025);
}

.option-content::after {
  position: absolute;
  right: -80px;
  bottom: -100px;
  width: 260px;
  height: 260px;
  content: "";
  border: 1px solid rgba(244, 201, 107, 0.2);
  border-radius: 50%;
  box-shadow: 0 0 0 25px rgba(244, 201, 107, 0.04), 0 0 0 50px rgba(244, 201, 107, 0.025);
  pointer-events: none;
}

.option-title {
  position: relative;
  z-index: 1;
  color: var(--cream);
  font-size: 44px;
  letter-spacing: 0.12em;
  text-shadow: 0 5px 18px rgba(0, 0, 0, 0.35);
}

.option-subtitle {
  position: relative;
  z-index: 1;
  margin: 9px 0 28px;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.18em;
}

.option-form {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-grid-options {
  grid-template-columns: 1fr;
}

.form-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 7px 10px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}

.color-dot,
.chip-dot {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.form-group label {
  flex-shrink: 0;
  min-width: 48px;
  color: rgba(255, 248, 233, 0.8);
  font-size: 13px;
}

.form-group select {
  min-width: 0;
  flex: 1;
  padding: 7px 9px;
  color: var(--cream);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  outline: none;
  background: rgba(10, 17, 30, 0.56);
  cursor: pointer;
}

.form-group select:focus {
  border-color: var(--gold);
}

.btn-begin,
#btn-restart {
  padding: 14px 28px;
  color: #2d2114;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffe09a, #d99b3c);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22), inset 0 1px rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0.12em;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.btn-begin:hover,
#btn-restart:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

/* =============================================
   In-game HUD
   ============================================= */

.game-hud {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  width: min(1440px, calc(100% - 40px));
  margin: 22px auto 16px;
  padding: 17px 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 24, 41, 0.78);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(15px);
}

.hud-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 190px;
}

.hud-eyebrow {
  color: var(--gold);
  font: 700 10px/1.2 Arial, sans-serif;
  letter-spacing: 0.2em;
}

.hud-title strong {
  color: var(--cream);
  font-size: 22px;
  letter-spacing: 0.12em;
}

.hud-title small {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.1em;
}

#status-bar {
  display: none;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
  flex: 1;
  font-size: 13px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.status-item .label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.turn-status {
  padding-right: 13px;
  border-right: 1px solid var(--line);
}

.day-status {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.day-status #round-count {
  color: var(--gold);
  font-weight: 800;
}

.team-indicator {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 11px;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  font-size: 12px;
  font-weight: 800;
}

#player-status {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

#player-status::-webkit-scrollbar {
  display: none;
}

.player-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 31px;
  padding: 5px 10px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.07);
  white-space: nowrap;
  font-size: 12px;
  transition: 0.2s ease;
}

.player-chip.current {
  color: var(--cream);
  border-color: rgba(244, 201, 107, 0.7);
  background: rgba(244, 201, 107, 0.14);
  box-shadow: 0 0 16px rgba(244, 201, 107, 0.12);
}

.player-chip.bankrupt {
  opacity: 0.35;
  text-decoration: line-through;
}

/* =============================================
   Main board layout
   ============================================= */

#game-main {
  display: none;
  align-items: flex-start;
  justify-content: center;
  gap: 18px;
  width: min(1440px, calc(100% - 40px));
  margin: 0 auto 28px;
}

.map {
  position: relative;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  grid-template-rows: repeat(7, minmax(0, 1fr));
  gap: 5px;
  width: min(980px, calc(100vw - 300px));
  aspect-ratio: 10 / 7;
  padding: 9px;
  border: 5px solid #6d4327;
  border-radius: 25px;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 2px, transparent 2px 6px),
    linear-gradient(135deg, #c58a4a, #86502b 55%, #633a24);
  box-shadow: var(--shadow), inset 0 0 0 2px rgba(255, 229, 166, 0.28), inset 0 0 35px rgba(47, 23, 10, 0.35);
  flex-shrink: 1;
}

.map::before {
  position: absolute;
  inset: 4px;
  z-index: 0;
  content: "";
  border: 1px solid rgba(255, 231, 177, 0.34);
  border-radius: 18px;
  pointer-events: none;
}

.box {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  text-align: center;
  border: 1px solid rgba(91, 48, 23, 0.64);
  border-radius: 9px;
  background: #f2dfba;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.24), 0 3px 7px rgba(43, 20, 8, 0.2);
  user-select: none;
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

.box:hover {
  z-index: 4;
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.box h3 {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 100%;
  min-height: 24px;
  padding: 4px 2px 3px;
  overflow: hidden;
  color: #fff9e9;
  border-bottom: 1px solid rgba(0, 0, 0, 0.18);
  background: rgba(45, 35, 31, 0.78);
  font-size: clamp(9px, 1.05vw, 13px);
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.box::after {
  position: absolute;
  top: 24px;
  right: 0;
  left: 0;
  height: 5px;
  content: "";
  background: rgba(190, 67, 68, 0.82);
}

.box .cell-icon {
  position: absolute;
  top: 31px;
  right: 0;
  bottom: 21px;
  left: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.78;
  font-size: clamp(18px, 2.4vw, 35px);
  line-height: 1;
  pointer-events: none;
  filter: saturate(0.9);
}

.box[data-place-type="property"]::after {
  background: linear-gradient(90deg, #b84b53, #e58a61);
}

.box .chr {
  position: absolute;
  bottom: 5px;
  left: 50%;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(23px, 3.3vw, 34px);
  height: clamp(23px, 3.3vw, 34px);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50% 50% 45% 45%;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.35), inset 0 2px 4px rgba(255, 255, 255, 0.35);
  font-size: clamp(9px, 1vw, 12px);
  font-weight: 900;
  transform: translateX(-50%);
  animation: tokenBounce 0.3s ease;
}

@keyframes tokenBounce {
  0% { transform: translateX(-50%) scale(0.5); }
  55% { transform: translateX(-50%) scale(1.18); }
  100% { transform: translateX(-50%) scale(1); }
}

.box img.house {
  position: absolute;
  bottom: 3px;
  left: 50%;
  z-index: 3;
  width: 75%;
  max-height: 45%;
  object-fit: contain;
  transform: translateX(-50%);
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.3));
}

.big-box {
  position: relative;
  z-index: 2;
  display: flex;
  grid-area: 2 / 2 / -2 / -2;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  text-align: center;
  border: 1px solid rgba(244, 201, 107, 0.35);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 30%, rgba(244, 201, 107, 0.18), transparent 48%),
    linear-gradient(145deg, rgba(24, 53, 68, 0.98), rgba(12, 25, 39, 0.98));
  box-shadow: inset 0 0 45px rgba(4, 14, 24, 0.55), 0 7px 15px rgba(40, 18, 7, 0.24);
}

.big-box::before,
.big-box::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(244, 201, 107, 0.25);
  border-radius: 50%;
  pointer-events: none;
}

.big-box::before { inset: 10%; }
.big-box::after { inset: 23%; border-color: rgba(255, 255, 255, 0.11); }

.control {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(240px, 68%);
  height: min(240px, 76%);
  gap: 7px;
}

.center-brand,
.center-turn,
.dice {
  position: relative;
  z-index: 2;
}

.center-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.center-brand-line {
  width: 42px;
  height: 2px;
  margin-bottom: 3px;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(244, 201, 107, 0.7);
}

.center-brand-kicker {
  color: var(--gold);
  font: 700 9px/1 Arial, sans-serif;
  letter-spacing: 0.24em;
}

.center-brand strong {
  color: var(--cream);
  font-size: clamp(18px, 2.1vw, 28px);
  letter-spacing: 0.16em;
}

.center-brand small {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.center-turn {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
}

.center-turn strong {
  color: var(--gold);
  font-size: 13px;
}

.center-turn small {
  display: none;
}

.dice {
  width: clamp(54px, 7vw, 82px);
  height: clamp(54px, 7vw, 82px);
  overflow: hidden;
  cursor: default;
  border: 3px solid rgba(255, 248, 233, 0.84);
  border-radius: 19px;
  box-shadow: 0 9px 18px rgba(0, 0, 0, 0.36), 0 0 0 7px rgba(244, 201, 107, 0.1);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.dice.pointer {
  cursor: pointer;
  animation: diceReady 1.8s ease-in-out infinite;
}

.dice.pointer:hover {
  filter: brightness(1.12);
  transform: scale(1.06);
}

@keyframes diceReady {
  0%, 100% { box-shadow: 0 9px 18px rgba(0, 0, 0, 0.36), 0 0 0 7px rgba(244, 201, 107, 0.1); }
  50% { box-shadow: 0 9px 22px rgba(0, 0, 0, 0.4), 0 0 0 11px rgba(244, 201, 107, 0.18); }
}

.slot {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  flex: 0 0 100%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* A repeated local track rolls upward only. Every position contains a full
   dice face, including the invisible reset point between rolls. */
.dice-track {
  width: 100%;
  will-change: transform;
}

.dice-track .dice-face {
  display: block;
  flex: 0 0 auto;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.slot1 { background-image: url("../../common/images/1.png"); }
.slot2 { background-image: url("../../common/images/2.png"); }
.slot3 { background-image: url("../../common/images/3.png"); }
.slot4 { background-image: url("../../common/images/4.png"); }
.slot5 { background-image: url("../../common/images/5.png"); }
.slot6 { background-image: url("../../common/images/6.png"); }

/* =============================================
   Rules panel
   ============================================= */

#rules-panel {
  width: 260px;
  max-height: min(690px, calc(100vh - 135px));
  flex: 0 0 260px;
  overflow: auto;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(18, 29, 47, 0.88);
  box-shadow: var(--shadow);
}

.rules-toggle {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 11px 12px;
  color: var(--cream);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  font-weight: 800;
}

.rules-toggle span {
  color: var(--gold);
  font-size: 11px;
  font-weight: 400;
}

#rules-panel h3 {
  margin-bottom: 14px;
  padding-bottom: 11px;
  color: var(--gold);
  border-bottom: 1px solid var(--line);
  font-size: 17px;
  letter-spacing: 0.08em;
}

.rule-section {
  margin-bottom: 15px;
}

.rule-section h4 {
  margin-bottom: 5px;
  color: var(--cream);
  font-size: 13px;
}

.rule-section li {
  padding: 2px 0 2px 14px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.rule-section li::before {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin: 0 8px 2px -13px;
  content: "";
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.75;
}

/* =============================================
   Dialogs and information cards
   ============================================= */

.dialog,
.infobox {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 20;
  transform: translate(-50%, -50%);
}

.dialog {
  display: none;
  width: min(430px, calc(100% - 32px));
  height: 230px;
  overflow: hidden;
  color: var(--cream);
  border: 1px solid rgba(244, 201, 107, 0.55);
  border-radius: 20px;
  background: linear-gradient(145deg, #263b55, #111c30);
  box-shadow: var(--shadow);
}

.dialog p {
  position: absolute;
  top: 94px;
  left: 0;
  width: 100%;
  padding: 0 28px;
  color: var(--cream);
  font-size: 18px;
  line-height: 1.6;
  text-align: center;
}

.dialog h2,
.infobox h2 {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 53px;
  padding-left: 22px;
  color: #342513;
  background: linear-gradient(135deg, #ffe09a, #d99b3c);
  font-size: 18px;
  font-weight: 900;
  line-height: 53px;
  letter-spacing: 0.1em;
}

.dialog .btn {
  position: absolute;
  bottom: 0;
  width: 50%;
  height: 52px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  line-height: 52px;
  text-align: center;
  transition: background 0.2s ease, color 0.2s ease;
}

.dialog .btn:first-of-type {
  left: 0;
  color: #2c2115;
  background: var(--gold);
}

.dialog .btn:last-of-type {
  right: 0;
  border-left: 1px solid var(--line);
}

.dialog .btn:hover {
  color: var(--cream);
  background: rgba(255, 255, 255, 0.18);
}

.dialog .btn:first-of-type:hover {
  color: #2c2115;
  background: #ffe7ad;
}

.msgbox {
  position: fixed;
  top: 18%;
  left: 50%;
  z-index: 30;
  display: none;
  width: min(560px, calc(100% - 32px));
  padding: 15px 23px;
  color: var(--cream);
  border: 1px solid rgba(244, 201, 107, 0.55);
  border-radius: 13px;
  background: rgba(22, 36, 57, 0.96);
  box-shadow: var(--shadow);
  font-size: 15px;
  line-height: 1.55;
  text-align: center;
  transform: translateX(-50%);
}

.infobox {
  display: none;
  width: 240px;
  height: 245px;
  overflow: hidden;
  color: var(--cream);
  border: 1px solid rgba(244, 201, 107, 0.55);
  border-radius: 18px;
  background: linear-gradient(145deg, #263b55, #111c30);
  box-shadow: var(--shadow);
}

.infobox ul {
  position: absolute;
  top: 70px;
  left: 0;
  width: 100%;
  padding: 10px 20px;
}

.infobox li {
  padding: 9px 0;
  color: var(--muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
}

.infobox li:last-child {
  color: var(--gold);
  border-bottom: 0;
  font-weight: 800;
}

/* Construction animation remains compatible with existing game.js. */
.construct img {
  position: absolute;
  z-index: 6;
}

.construct img:first-child { width: 100%; bottom: 0; left: 50%; transform: translateX(-50%); animation: c1 2s; }
.construct img:nth-child(2) { width: 100%; bottom: 3%; right: -30%; animation: c2 2s; }
.construct img:nth-child(3) { width: 100%; bottom: 3%; left: -30%; animation: c3 2s; }
.construct img:nth-child(4) { width: 50%; bottom: 30%; right: 0; transform: rotate(-45deg); animation: c4 2s; }
.construct img:nth-child(5) { width: 180%; bottom: -13%; left: -30%; animation: c5 2s; }

@keyframes c1 { 0% { opacity: 0; } 80% { opacity: 1; } 100% { opacity: 0; } }
@keyframes c2 { 0% { opacity: 0; right: -100%; } 80% { opacity: 1; } 100% { opacity: 0; right: -30%; } }
@keyframes c3 { 0% { opacity: 0; left: -100%; } 80% { opacity: 1; } 100% { opacity: 0; left: -30%; } }
@keyframes c4 { 0%, 100% { opacity: 0; transform: rotate(-45deg); } 20%, 80% { opacity: 1; } 40%, 60% { transform: rotate(-90deg); } }
@keyframes c5 { 0%, 50% { opacity: 0; } 80% { opacity: 1; } 100% { opacity: 0; } }

/* =============================================
   Game over
   ============================================= */

#game-over {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5, 10, 20, 0.78);
  backdrop-filter: blur(10px);
}

#game-over .overlay-content {
  width: min(450px, calc(100% - 32px));
  padding: 42px 28px;
  text-align: center;
  border: 1px solid rgba(244, 201, 107, 0.55);
  border-radius: 22px;
  background: linear-gradient(145deg, #263b55, #111c30);
  box-shadow: var(--shadow);
}

#game-over h2 {
  margin-bottom: 18px;
  color: var(--cream);
  font-size: 25px;
  line-height: 1.5;
}

/* =============================================
   Responsive
   ============================================= */

@media (max-width: 1100px) {
  #game-main {
    flex-direction: column;
    align-items: center;
  }

  .map {
    width: min(900px, 100%);
  }

  #rules-panel {
    width: min(900px, 100%);
    max-height: none;
    flex-basis: auto;
  }

  .rules-toggle {
    display: flex;
  }

  .rules-body {
    display: none;
    padding-top: 14px;
  }

  #rules-panel.expanded .rules-body {
    display: block;
  }
}

@media (min-width: 1101px) {
  .rules-body {
    display: block !important;
  }
}

@media (max-width: 760px) {
  .option-content {
    padding: 32px 20px;
    border-radius: 20px;
  }

  .option-title {
    font-size: 34px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .game-hud {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
    width: calc(100% - 20px);
    margin-top: 10px;
    padding: 15px;
  }

  #status-bar {
    align-items: flex-start;
    justify-content: flex-start;
    flex-wrap: wrap;
    width: 100%;
  }

  #player-status {
    width: 100%;
    order: 3;
  }

  .turn-status {
    border-right: 0;
  }

  #game-main {
    width: calc(100% - 20px);
    margin-top: 4px;
  }

  .map {
    gap: 3px;
    width: 100%;
    padding: 5px;
    border-width: 3px;
    border-radius: 16px;
  }

  .box {
    border-radius: 5px;
  }

  .box h3 {
    min-height: 16px;
    padding: 2px 1px;
    font-size: clamp(7px, 2.1vw, 10px);
  }

  .box::after {
    top: 16px;
    height: 3px;
  }

  .box .cell-icon {
    top: 22px;
    bottom: 17px;
    font-size: clamp(13px, 5vw, 24px);
  }

  .box .chr {
    bottom: 2px;
    width: clamp(17px, 5.5vw, 26px);
    height: clamp(17px, 5.5vw, 26px);
    font-size: 7px;
  }

  .big-box {
    border-radius: 11px;
  }

  .control {
    width: 90%;
    height: 90%;
    gap: 4px;
  }

  .center-brand strong {
    font-size: clamp(13px, 4vw, 20px);
  }

  .center-brand small,
  .center-turn small {
    display: none;
  }

  .center-turn {
    font-size: 8px;
  }

  .dice {
    width: clamp(38px, 13vw, 58px);
    height: clamp(38px, 13vw, 58px);
    border-width: 2px;
    border-radius: 12px;
  }

  .dialog {
    height: 220px;
  }

  .dialog p {
    top: 92px;
    padding: 0 20px;
    font-size: 15px;
  }

  .msgbox {
    top: 16%;
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
