:root {
  --paper: #f7f2e7;
  --ink: #1d2730;
  --muted: #66737f;
  --panel: #fffdfa;
  --line: #dfd4c2;
  --green: #2f7d5f;
  --red: #c95545;
  --blue: #264b62;
  --gold: #e0aa3f;
  --shadow: 0 14px 34px rgba(55, 43, 27, .12);
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(247, 242, 231, .82), rgba(247, 242, 231, .94)),
    url("/assets/tabletop-bg.jpg"),
    linear-gradient(135deg, rgba(47, 125, 95, .10), transparent 34%),
    linear-gradient(315deg, rgba(201, 85, 69, .10), transparent 30%),
    var(--paper);
  background-size: cover, cover, auto, auto, auto;
  background-position: center;
  background-attachment: fixed;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.shell {
  width: min(1060px, 100%);
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}

.hidden {
  display: none !important;
}

.join-view {
  min-height: calc(100vh - 44px);
  display: grid;
  align-content: center;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mark {
  width: 58px;
  height: 58px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 8px;
  border-radius: 8px;
  background: var(--blue);
  box-shadow: var(--shadow);
}

.mark span {
  border-radius: 4px;
  background: var(--panel);
}

.mark span:nth-child(2) {
  background: var(--gold);
}

.mark span:nth-child(3) {
  background: var(--green);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 34px;
  line-height: 1.15;
}

h2 {
  font-size: 17px;
  line-height: 1.3;
}

.join-panel,
.players-card,
.log-card,
.turn-card {
  border: 1px solid rgba(116, 92, 58, .18);
  border-radius: 8px;
  background: rgba(255, 253, 250, .9);
  box-shadow: var(--shadow);
}

.join-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.identity-row {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 10px;
}

.setup-grid {
  display: grid;
  grid-template-columns: 1.25fr .85fr;
  gap: 12px;
}

.character-studio {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  min-height: 174px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .78);
}

.character-lead {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  padding: 8px 8px 0;
  background: linear-gradient(155deg, #e6efe9, #efe2ce);
}

.gender-tabs {
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.gender-tabs label {
  position: relative;
  display: block;
}

.gender-tabs input,
.outfit-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  opacity: 0;
}

.gender-tabs span {
  display: grid;
  place-items: center;
  min-height: 28px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .68);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.gender-tabs input:checked + span {
  background: var(--blue);
  color: white;
}

#characterHero {
  width: 100%;
  height: 138px;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 7px 6px rgba(43, 33, 23, .17));
}

.wardrobe {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.outfit-card {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  min-width: 0;
  overflow: hidden;
  padding: 4px 3px 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f6f0e6;
  cursor: pointer;
}

.outfit-card:has(input:checked) {
  border-color: var(--green);
  box-shadow: inset 0 0 0 2px rgba(47, 125, 95, .18);
}

.outfit-card img {
  width: 100%;
  height: 118px;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 5px 4px rgba(43, 33, 23, .13));
}

.outfit-card b {
  font-size: 10px;
}

.game-settings {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .7);
}

.game-settings summary {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.game-settings summary::-webkit-details-marker {
  display: none;
}

.game-settings summary span {
  color: var(--muted);
}

.game-settings .setup-grid {
  padding: 0 8px 8px;
}

fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
}

legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.choice {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.choice input {
  width: auto;
  min-height: 0;
  accent-color: var(--green);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input {
  min-height: 48px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 125, 95, .16);
}

.join-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.primary,
.secondary,
.roll-btn,
.room-code,
.sound-toggle {
  min-height: 48px;
  border-radius: 8px;
  font-weight: 800;
  transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
}

.primary,
.roll-btn {
  background: var(--green);
  color: #fff;
  box-shadow: 0 10px 22px rgba(47, 125, 95, .22);
}

.secondary,
.room-code,
.sound-toggle {
  background: #fff;
  color: var(--blue);
  border: 1px solid var(--line);
}

.sound-toggle.active {
  background: var(--blue);
  color: #fff;
}

.primary:active,
.secondary:active,
.roll-btn:active,
.room-code:active {
  transform: translateY(1px);
}

.hint {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.game-view {
  display: grid;
  gap: 14px;
}

.topbar {
  display: grid;
  grid-template-columns: 116px 1fr 74px;
  gap: 10px;
  align-items: stretch;
}

.room-code {
  width: 100%;
  font-size: 22px;
  letter-spacing: 0;
}

.turn-card {
  padding: 10px 12px;
}

.turn-card strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 20px;
}

.turn-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
}

body[data-scene="nightMarket"] {
  --green: #2f7d86;
  --blue: #26324f;
  --gold: #f0b84f;
  --red: #c45a78;
}

body[data-scene="harbor"] {
  --green: #2f7d72;
  --blue: #24546d;
  --gold: #dfb85a;
  --red: #c96a54;
}

body[data-scene="garden"] {
  --green: #4f7f57;
  --blue: #3e4768;
  --gold: #d7b95c;
  --red: #bd6687;
}

.board-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 138px;
  gap: 12px;
  align-items: stretch;
}

.board {
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 5px;
  padding: 8px;
  border: 1px solid rgba(116, 92, 58, .18);
  border-radius: 8px;
  background: #efe2c9;
  box-shadow: var(--shadow);
}

.tile {
  position: relative;
  min-width: 0;
  border-radius: 6px;
  background: #fffdfa;
  border: 1px solid rgba(112, 91, 61, .14);
  overflow: hidden;
}

.tile::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 7px;
  background: var(--tile-color, #d7c8ad);
}

.tile.start::before {
  background: var(--blue);
}

.tile.event::before,
.tile.bonus::before,
.tile.kindness::before {
  background: var(--green);
}

.tile.kindness {
  background: #edf8f2;
  border-color: rgba(47, 125, 95, .3);
}

.tile.tax::before {
  background: var(--red);
}

.tile-inner {
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 1px;
  padding: 28px 4px 3px;
}

.tile-art {
  display: grid;
  place-items: center;
  min-height: 0;
  border-radius: 4px;
  background: #f5ecdd;
  background:
    radial-gradient(circle at 50% 85%, rgba(255,255,255,.92) 0 31%, transparent 32%),
    linear-gradient(145deg, color-mix(in srgb, var(--tile-color, #d7c8ad) 22%, white), #f5ecdd);
  box-shadow: inset 0 -8px 14px rgba(74, 57, 39, .05);
}

.tile-art span {
  font-size: clamp(17px, 3.2vw, 30px);
  line-height: 1;
  filter: drop-shadow(0 3px 2px rgba(55, 40, 27, .16));
  transform: translateY(1px);
}

.tile.kindness .tile-art {
  background: linear-gradient(145deg, #d6eee4, #fff4c9);
}

.tile-copy {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.tile-name {
  overflow: hidden;
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-meta {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.center-tile {
  position: relative;
  grid-column: 2 / 5;
  grid-row: 2 / 5;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  padding: 12px;
  border-radius: 8px;
  background-color: var(--blue);
  background-position: center;
  background-repeat: no-repeat;
  background-size: auto 108%;
  color: #fff;
  text-align: center;
  animation: scene-breathe 9s ease-in-out infinite alternate;
}

.center-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(10, 18, 24, .06), rgba(10, 18, 24, .22));
}

.center-tile.scene-classic {
  background-image: url("/assets/scene-classic.jpg");
}

.center-tile.scene-nightMarket {
  background-image: url("/assets/scene-night-market.jpg");
}

.center-tile.scene-harbor {
  background-image: url("/assets/scene-harbor.jpg");
}

.center-tile.scene-garden {
  background-image: url("/assets/scene-garden.jpg");
}

.center-copy {
  position: relative;
  z-index: 3;
  width: min(86%, 280px);
  padding: 12px 10px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 7px;
  background: rgba(20, 29, 33, .58);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .18);
  backdrop-filter: blur(5px);
}

.center-copy small {
  display: block;
  margin-bottom: 4px;
  color: #f4d982;
  font-size: 10px;
  font-weight: 900;
}

.center-tile strong {
  display: block;
  font-size: clamp(18px, 3.3vw, 28px);
  line-height: 1.2;
}

.center-tile span {
  display: block;
  margin-top: 8px;
  color: rgba(255, 255, 255, .72);
  font-size: clamp(10px, 1.6vw, 12px);
  line-height: 1.4;
}

.scene-motion {
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

.center-tile::after {
  content: "";
  position: absolute;
  inset: -15%;
  z-index: 0;
  background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.16) 50%, transparent 65%);
  transform: translateX(-70%);
  animation: scene-sweep 6s ease-in-out infinite;
  pointer-events: none;
}

.scene-classic .scene-motion-a {
  top: 9%;
  left: -28%;
  width: 55%;
  height: 12%;
  border-radius: 999px;
  background: rgba(255, 255, 255, .33);
  filter: blur(7px);
  animation: cloud-drift 16s linear infinite;
}

.scene-classic .scene-motion-b {
  right: 8%;
  bottom: 12%;
  width: 48%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 224, 151, .8), transparent);
  animation: city-light 4s ease-in-out infinite;
}

.scene-nightMarket .scene-motion-a {
  inset: 0;
  background: radial-gradient(circle at 72% 22%, rgba(255, 65, 153, .28), transparent 27%);
  animation: neon-pulse 2.7s ease-in-out infinite;
}

.scene-nightMarket .scene-motion-b {
  left: 13%;
  bottom: 6%;
  width: 22%;
  height: 38%;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  filter: blur(11px);
  animation: steam-rise 5s ease-in-out infinite;
}

.scene-harbor .scene-motion-a {
  inset: 48% -15% -20%;
  background: repeating-radial-gradient(ellipse at center, rgba(255,255,255,.22) 0 2px, transparent 3px 15px);
  animation: water-shimmer 7s linear infinite;
}

.scene-harbor .scene-motion-b {
  top: 24%;
  left: 36%;
  width: 13%;
  height: 3px;
  border-radius: 50%;
  background: white;
  box-shadow: 7px -3px 0 -1px white;
  animation: sail-drift 12s ease-in-out infinite;
}

.scene-garden .scene-motion-a,
.scene-garden .scene-motion-b {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffe894;
  box-shadow: 30px 26px #80e8d2, 68px -9px #ffd4ed, 104px 39px #ffe894, 142px 3px #80e8d2;
  animation: firefly-float 6s ease-in-out infinite alternate;
}

.scene-garden .scene-motion-a {
  left: 13%;
  top: 25%;
}

.scene-garden .scene-motion-b {
  right: 14%;
  bottom: 25%;
  animation-delay: -2s;
}

.token-stack {
  position: absolute;
  top: 3px;
  left: 3px;
  right: 3px;
  height: 25px;
  display: flex;
  align-items: center;
  gap: 1px;
  z-index: 4;
  border-bottom: 1px solid rgba(100, 78, 51, .09);
  background: rgba(255, 255, 255, .58);
  backdrop-filter: blur(2px);
}

.character-token {
  width: 20px;
  height: 27px;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 2px 1px rgba(0,0,0,.25));
  border-bottom: 3px solid var(--player-color);
  border-radius: 0 0 5px 5px;
}

.character-token.just-moved {
  animation: token-arrive 650ms cubic-bezier(.2, .8, .2, 1);
}

.dice-panel {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(116, 92, 58, .18);
  border-radius: 8px;
  background: rgba(255, 253, 250, .9);
  box-shadow: var(--shadow);
}

.die-face {
  width: 92px;
  height: 92px;
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 8px;
  padding: 16px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: inset 0 -4px 0 rgba(29, 39, 48, .08), 0 12px 24px rgba(29, 39, 48, .12);
}

.die-face.rolling {
  animation: shake 420ms ease;
}

.die-face span {
  border-radius: 50%;
  background: transparent;
}

.die-face[data-value="1"] span:nth-child(5),
.die-face[data-value="2"] span:nth-child(1),
.die-face[data-value="2"] span:nth-child(9),
.die-face[data-value="3"] span:nth-child(1),
.die-face[data-value="3"] span:nth-child(5),
.die-face[data-value="3"] span:nth-child(9),
.die-face[data-value="4"] span:nth-child(1),
.die-face[data-value="4"] span:nth-child(3),
.die-face[data-value="4"] span:nth-child(7),
.die-face[data-value="4"] span:nth-child(9),
.die-face[data-value="5"] span:nth-child(1),
.die-face[data-value="5"] span:nth-child(3),
.die-face[data-value="5"] span:nth-child(5),
.die-face[data-value="5"] span:nth-child(7),
.die-face[data-value="5"] span:nth-child(9),
.die-face[data-value="6"] span:nth-child(1),
.die-face[data-value="6"] span:nth-child(3),
.die-face[data-value="6"] span:nth-child(4),
.die-face[data-value="6"] span:nth-child(6),
.die-face[data-value="6"] span:nth-child(7),
.die-face[data-value="6"] span:nth-child(9) {
  background: var(--blue);
}

.compact {
  min-height: 40px;
}

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

.action-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(47, 125, 95, .25);
  border-radius: 8px;
  background: #fffdfa;
  box-shadow: var(--shadow);
}

.action-detail {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.action-buttons {
  display: flex;
  gap: 8px;
}

.action-buttons button {
  min-width: 82px;
  padding: 0 14px;
}

.players-card,
.log-card {
  min-width: 0;
  padding: 12px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.section-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.players {
  display: grid;
  gap: 8px;
}

.player-row {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 56px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(239, 226, 201, .5);
}

.player-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 42px;
  border: 2px solid #fff;
  border-radius: 8px;
  background: #f5eadc;
  background: color-mix(in srgb, var(--player-color) 25%, white);
  box-shadow: 0 3px 8px rgba(50, 40, 29, .14);
  overflow: hidden;
}

.player-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 3px 2px rgba(43, 33, 23, .18));
}

.player-copy {
  display: grid;
  min-width: 0;
}

.player-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.player-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.coins {
  display: grid;
  justify-items: end;
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.coins small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.log {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.log li {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 10;
  max-width: calc(100% - 32px);
  transform: translate(-50%, 12px);
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(29, 39, 48, .94);
  color: #fff;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.copyright {
  position: absolute;
  right: max(10px, env(safe-area-inset-right));
  bottom: max(7px, env(safe-area-inset-bottom));
  z-index: 2;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(255, 253, 250, .72);
  color: rgba(29, 39, 48, .58);
  font-size: 10px;
  font-weight: 700;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

@keyframes shake {
  0%, 100% { transform: rotate(0deg) scale(1); }
  30% { transform: rotate(-8deg) scale(1.03); }
  60% { transform: rotate(8deg) scale(1.03); }
}

@keyframes cloud-drift {
  from { transform: translateX(0); }
  to { transform: translateX(240%); }
}

@keyframes city-light {
  0%, 100% { opacity: .25; transform: translateX(-12%); }
  50% { opacity: 1; transform: translateX(12%); }
}

@keyframes neon-pulse {
  0%, 100% { opacity: .4; }
  50% { opacity: 1; }
}

@keyframes steam-rise {
  0% { opacity: 0; transform: translateY(12px) scale(.7); }
  55% { opacity: .5; }
  100% { opacity: 0; transform: translate(12px, -38px) scale(1.25); }
}

@keyframes water-shimmer {
  from { transform: translateX(-2%); }
  to { transform: translateX(9%); }
}

@keyframes sail-drift {
  0%, 100% { transform: translateX(-28px); }
  50% { transform: translateX(42px); }
}

@keyframes firefly-float {
  from { opacity: .35; transform: translate(-5px, 8px); }
  to { opacity: 1; transform: translate(10px, -12px); }
}

@keyframes scene-breathe {
  from { background-size: auto 108%; background-position: 45% 50%; }
  to { background-size: auto 118%; background-position: 57% 48%; }
}

@keyframes scene-sweep {
  0%, 25% { transform: translateX(-70%); opacity: 0; }
  55% { opacity: .8; }
  85%, 100% { transform: translateX(70%); opacity: 0; }
}

@keyframes token-arrive {
  0% { transform: translateY(-9px) scale(.72); opacity: .2; }
  55% { transform: translateY(2px) scale(1.12); opacity: 1; }
  100% { transform: translateY(0) scale(1); }
}

@media (max-width: 760px) {
  .shell {
    padding-inline: 12px;
    padding-bottom: max(42px, env(safe-area-inset-bottom));
  }

  .board-wrap,
  .status-grid {
    grid-template-columns: 1fr;
  }

  .dice-panel {
    grid-template-columns: 88px 1fr 74px 68px;
    align-items: center;
  }

  .die-face {
    width: 82px;
    height: 82px;
    padding: 14px;
  }
  .action-card {
    grid-template-columns: 1fr;
  }

  .action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

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

  .tile-meta {
    font-size: 8px;
  }

  .character-token {
    width: 17px;
    height: 23px;
  }
}

@media (max-width: 380px) {
  h1 {
    font-size: 29px;
  }

  .join-actions,
  .setup-grid,
  .identity-row,
  .topbar {
    grid-template-columns: 1fr;
  }

  .character-studio {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  #characterHero {
    height: 125px;
  }

  .outfit-card img {
    height: 104px;
  }

  .dice-panel {
    grid-template-columns: 1fr;
  }

  .die-face {
    width: 88px;
    height: 88px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
  }
}
