:root {
  --ink: #222;
  --paper: #f8f5f0;
  --paper-light: #fff;
  --primary: #3a8571;
  --primary-dark: #144238;
  --primary-light: #d1edea;
  --line: #e5e7eb;
  --red: #e3312b;
  --yellow: #f6c919;
  --green: #2d9b55;
  --blue: #2878bd;
  --shadow: rgba(17, 24, 39, 0.14);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Inter", Arial, sans-serif;
}

.game-maedn.is-game-active .site-header-inner {
  min-height: 54px;
  padding-block: .38rem;
}

.game-maedn.is-game-active .site-brand-logo {
  width: 38px;
  height: 38px;
  padding: 2px;
}

.game-maedn.is-game-active .site-brand-name {
  font-size: 1.05rem;
}

.game-maedn.is-game-active .site-brand-name small {
  margin-top: .08rem;
  font-size: .58rem;
}

.turn-overlay {
  --turn-ink: #fff;
  --turn-accent: #fff;
  position: fixed;
  z-index: 90;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  color: var(--turn-ink);
  background: rgba(39, 42, 41, 0.84);
  opacity: 0;
  pointer-events: none;
}

.turn-overlay.is-visible {
  animation: show-turn 900ms ease-in-out both;
}

.turn-overlay.is-visible.is-winner {
  animation-duration: 1800ms;
}

.turn-overlay span {
  font-size: clamp(0.7rem, 1.5vw, 0.9rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.turn-overlay strong {
  color: var(--turn-accent);
  font-family: "Inter", Arial, sans-serif;
  font-size: clamp(2.8rem, 10vw, 7rem);
  line-height: 0.95;
  text-align: center;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.42);
}

.turn-overlay[data-color="red"] { --turn-accent: #ff6d66; }
.turn-overlay[data-color="yellow"] { --turn-accent: #ffda3f; }
.turn-overlay[data-color="green"] { --turn-accent: #5fd486; }
.turn-overlay[data-color="blue"] { --turn-accent: #68b4ed; }

.turn-overlay.is-visible strong {
  animation: show-turn-name 900ms ease-out both;
}

.turn-overlay.is-visible.is-winner strong {
  animation-duration: 1800ms;
}

@keyframes show-turn {
  0%, 100% { opacity: 0; }
  18%, 72% { opacity: 1; }
}

@keyframes show-turn-name {
  0% { opacity: 0; transform: scale(0.82); }
  22%, 72% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.04); }
}

button,
input,
select {
  font: inherit;
}

.setup-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 66, 56, 0.72);
  backdrop-filter: blur(8px);
}

.setup-overlay[hidden] {
  display: none;
}

.setup-card {
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: clamp(24px, 5vw, 42px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-light);
  box-shadow: 0 24px 70px rgba(17, 24, 39, 0.22);
}

.setup-card h2 {
  margin: 8px 0 26px;
  color: var(--primary-dark);
  font-family: "Inter", Arial, sans-serif;
  font-size: clamp(1.9rem, 6vw, 3rem);
  line-height: 1.06;
  letter-spacing: -0.04em;
}

.count-field,
.player-inputs label {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  font-weight: 700;
}

.setup-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.count-field {
  grid-template-columns: 1fr;
  align-content: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f9fafb;
}

.count-field select,
.player-inputs input {
  border: 1px solid #d1d5db;
  border-radius: 5px;
  color: var(--ink);
  background: #fff;
}

.count-field select {
  width: 100%;
  padding: 8px 10px;
}

.room-variant-field small {
  display: block;
  margin-top: 3px;
  color: #6b7280;
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.35;
}

.tnt-option {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff8ed;
  cursor: pointer;
}

.tnt-option input {
  width: 18px;
  height: 18px;
  accent-color: #b5281e;
}

.tnt-option span {
  display: grid;
  gap: 2px;
  font-size: 0.78rem;
}

.tnt-option small {
  color: #6b7280;
  font-weight: 500;
}

.room-tnt-option {
  margin-top: 0;
}

.player-inputs {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.player-inputs label {
  grid-template-columns: 16px 55px 1fr;
}

.player-inputs input {
  min-width: 0;
  padding: 10px 12px;
}

.color-dot {
  width: 14px;
  aspect-ratio: 1;
  border: 1px solid rgba(0, 0, 0, 0.4);
  border-radius: 50%;
}

.color-dot.red { background: var(--red); }
.color-dot.yellow { background: var(--yellow); }
.color-dot.green { background: var(--green); }
.color-dot.blue { background: var(--blue); }

.setup-note {
  margin: 0 0 20px;
  color: #6b7280;
  font-size: 0.82rem;
}

.room-lobby-card {
  display: grid;
  gap: 18px;
}

.room-lobby-card h2,
.room-lobby-card .eyebrow,
.room-lobby-card .setup-note {
  margin: 0;
}

.room-code-label {
  margin: 4px 0 -14px;
  color: #756b5b;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.room-code {
  color: var(--ink);
  font-family: "Inter", Arial, sans-serif;
  font-size: clamp(2.4rem, 10vw, 4.2rem);
  letter-spacing: 0.14em;
  line-height: 1;
}

.room-player-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.room-player-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 5px;
  background: #f9fafb;
  font-weight: 700;
}

.room-player-list small {
  color: #766c5d;
  font-weight: 400;
}

.room-leave-link {
  padding: 0;
  border: 0;
  color: #71685b;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
  text-decoration: underline;
  cursor: pointer;
}

.primary-button,
.secondary-button {
  width: 100%;
  padding: 12px 16px;
  border-radius: 5px;
  font-weight: 700;
  cursor: pointer;
}

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

.primary-button {
  border: 1px solid var(--primary);
  color: #fff;
  background: var(--primary);
}

.primary-button:hover {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
}

.page-shell {
  width: min(1100px, 92%);
  margin: 0 auto;
  padding: clamp(30px, 5vw, 58px) 0;
}

.eyebrow {
  margin: 0;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.game-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 245px;
  align-items: start;
  gap: 26px;
  min-width: 0;
}

.board-frame {
  width: 100%;
  min-width: 0;
  padding: 4px;
  border: 1px solid #d8d3ca;
  border-radius: 3px;
  background: #e9e5dd;
  box-shadow: 0 4px 14px rgba(31, 36, 34, 0.08);
}

.board {
  --active-player-color: #817969;
  position: relative;
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  grid-template-rows: repeat(11, 1fr);
  aspect-ratio: 1;
  width: 100%;
  min-width: 0;
  padding: 2.2%;
  border: 1px solid var(--active-player-color);
  border-radius: 1px;
  overflow: hidden;
  background:
    repeating-linear-gradient(0deg, rgba(92, 71, 36, 0.018) 0 1px, transparent 1px 5px),
    #f7f5eb;
  background-size: calc(100% / 11) calc(100% / 11);
  box-shadow:
    inset 0 0 28px rgba(84, 59, 24, 0.13),
    0 0 0 3px var(--active-player-color);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.board[data-active-color="red"] { --active-player-color: var(--red); }
.board[data-active-color="yellow"] { --active-player-color: var(--yellow); }
.board[data-active-color="green"] { --active-player-color: var(--green); }
.board[data-active-color="blue"] { --active-player-color: var(--blue); }

.home {
  position: relative;
  z-index: 0;
  margin: 3%;
  border: clamp(5px, 0.8vw, 10px) solid;
  border-radius: 50%;
  opacity: 0.22;
  transition: opacity 220ms ease, filter 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

.home-red {
  grid-area: 8 / 8 / 12 / 12;
  border-color: var(--red);
  background: color-mix(in srgb, var(--red) 22%, white);
}

.home-yellow {
  grid-area: 1 / 1 / 5 / 5;
  border-color: var(--yellow);
  background: color-mix(in srgb, var(--yellow) 22%, white);
}

.home-green {
  grid-area: 1 / 8 / 5 / 12;
  border-color: var(--green);
  background: color-mix(in srgb, var(--green) 22%, white);
}

.home-blue {
  grid-area: 8 / 1 / 12 / 5;
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 22%, white);
}

.board[data-active-color="red"] .home-red,
.board[data-active-color="yellow"] .home-yellow,
.board[data-active-color="green"] .home-green,
.board[data-active-color="blue"] .home-blue {
  z-index: 1;
  opacity: 0.48;
  filter: saturate(1.08);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8), 0 0 0 4px currentColor;
}

.board.pulse-sync[data-active-color="red"] .home-red::after,
.board.pulse-sync[data-active-color="yellow"] .home-yellow::after,
.board.pulse-sync[data-active-color="green"] .home-green::after,
.board.pulse-sync[data-active-color="blue"] .home-blue::after {
  content: "";
  position: absolute;
  inset: -9px;
  border: 3px solid currentColor;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.72;
  transform: scale(1.03);
}

.home-red { color: var(--red); }
.home-yellow { color: #c89b00; }
.home-green { color: var(--green); }
.home-blue { color: var(--blue); }

.field {
  --field-color: var(--paper-light);
  --accent: #777;
  --accent-dark: #333;
  position: relative;
  z-index: 2;
  place-self: center;
  width: 74%;
  aspect-ratio: 1;
  padding: 0;
  border: max(1px, 0.1vw) solid #59564f;
  border-radius: 50%;
  color: var(--ink);
  background: var(--field-color);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.75), 0 1px 2px rgba(32, 32, 29, 0.13);
  font: 700 clamp(0.48rem, 1.25vw, 0.82rem) / 1 "Inter", Arial, sans-serif;
  cursor: default;
  transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease, opacity 150ms ease;
  -webkit-tap-highlight-color: transparent;
}

.field[data-color="red"] {
  --accent: var(--red);
  --accent-dark: #8e261f;
}

.field[data-color="yellow"] {
  --accent: var(--yellow);
  --accent-dark: #94710c;
}

.field[data-color="green"] {
  --accent: var(--green);
  --accent-dark: #18583b;
}

.field[data-color="blue"] {
  --accent: var(--blue);
  --accent-dark: #174d72;
}

.field-start {
  --field-color: var(--accent);
  border-color: var(--accent-dark);
  color: #fff;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.5), 0 3px 0 var(--accent-dark);
}

.field-goal {
  --field-color: color-mix(in srgb, var(--accent) 48%, white);
  border-color: var(--accent-dark);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.58), 0 2px 0 rgba(32, 32, 29, 0.16);
}

.field-house {
  --field-color: #fffef7;
  border: max(1px, 0.1vw) solid var(--accent);
  box-shadow:
    inset 0 0 0 2px color-mix(in srgb, var(--accent) 22%, white),
    0 0 0 max(2px, 0.18vw) var(--accent),
    0 3px 0 color-mix(in srgb, var(--accent-dark) 60%, transparent);
}

.field.is-item-field {
  border-color: #7860a7;
  background: radial-gradient(circle at 35% 28%, #fff 0 9%, #d6c8ff 32%, #7b60bd 100%);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.48), 0 2px 0 #554176;
}

.question-marker {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  color: #fff;
  font: 900 clamp(.8rem, 1.8vw, 1.45rem)/1 "Inter", sans-serif;
  text-shadow: 0 2px 0 #483272, 0 0 5px rgba(255,255,255,.8);
  animation: question-glow 1.05s ease-in-out infinite;
}

.placed-bomb-marker {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  font-size: clamp(1.3rem, 3vw, 2.35rem);
  line-height: 1;
  text-align: center;
  filter: drop-shadow(0 2px 1px rgba(0,0,0,.35));
  animation: placed-bomb-pulse 1.05s ease-in-out infinite;
}

.field.has-placed-bomb .question-marker { opacity: 0; }

@keyframes question-glow {
  50% { transform: scale(1.12) rotate(3deg); filter: brightness(1.18); }
}

@keyframes placed-bomb-pulse {
  50% { transform: scale(1.12); }
}

.tnt-marker {
  position: absolute;
  z-index: 3;
  top: -6%;
  left: -6%;
  display: grid;
  place-items: center;
  width: 112%;
  height: 112%;
  border: max(1px, 0.12vw) solid #4d2d17;
  border-radius: 12%;
  color: #2d170c;
  background:
    repeating-linear-gradient(0deg, transparent 0 18%, rgba(78, 39, 14, 0.18) 19% 22%, transparent 23% 36%),
    linear-gradient(135deg, #e4a650 0%, #bb6c2e 52%, #8b461f 100%);
  box-shadow:
    inset 2px 2px 2px rgba(255, 222, 157, 0.55),
    inset -2px -3px 2px rgba(69, 31, 12, 0.32),
    0 2px 0 #5b321c,
    0 4px 5px rgba(42, 24, 14, 0.3);
  font-size: clamp(0.34rem, 0.72vw, 0.58rem);
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
  transform: rotate(-4deg);
  transform-origin: 50% 78%;
  will-change: transform, filter;
  animation: tnt-idle-pulse 1.05s ease-in-out infinite;
}

.tnt-marker {
  border: 0;
  background: transparent url("assets/tnt-item.png") 50% 50% / contain no-repeat;
  box-shadow: none;
}

.tnt-marker::before,
.tnt-marker::after {
  display: none;
}

.tnt-marker::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 41% -4% auto;
  height: 18%;
  border-top: 1px solid rgba(68, 33, 13, 0.5);
  border-bottom: 1px solid rgba(255, 203, 119, 0.35);
  background: #6f381c;
  transform: rotate(-35deg);
}

.tnt-marker::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 41% -4% auto;
  height: 18%;
  border-top: 1px solid rgba(68, 33, 13, 0.5);
  border-bottom: 1px solid rgba(255, 203, 119, 0.35);
  background: #6f381c;
  transform: rotate(35deg);
}

.tnt-crate-label {
  position: relative;
  z-index: 2;
  padding: 8% 10% 6%;
  border: 1px solid #731810;
  border-radius: 2px;
  color: #fff4d3;
  background: #b52d1f;
  box-shadow: 0 1px 0 rgba(66, 21, 12, 0.55);
  font-size: 0.82em;
  letter-spacing: -0.04em;
  text-shadow: 0 1px 0 #64150f;
  transform-origin: 50% 50%;
  animation: tnt-label-pulse 1.05s ease-in-out infinite;
}

.tnt-countdown {
  position: absolute;
  z-index: 3;
  top: -28%;
  right: -25%;
  left: auto;
  display: grid;
  place-items: center;
  width: 58%;
  height: 58%;
  box-sizing: border-box;
  padding: 0;
  border: max(2px, 0.15vw) solid #fff8e8;
  border-radius: 50%;
  color: #fff;
  background: #201d1a;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 0 0 max(1px, 0.08vw) #4a2112,
    0 3px 5px rgba(31, 20, 14, 0.42);
  font-size: clamp(0.6rem, 1.26vw, 1.02rem);
  font-family: Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  line-height: 1;
  text-align: center;
  text-shadow: 0 1px 0 #000;
}

.tnt-countdown > span {
  display: block;
  line-height: 1;
  transform: translateY(-0.055em);
}

.tnt-countdown.is-counting {
  animation: tnt-count 170ms ease-out;
}

.tnt-countdown-pop {
  z-index: 85;
  right: auto;
  pointer-events: none;
}

.tnt-marker.is-exploding {
  z-index: 8;
  animation: tnt-crate-explode 620ms cubic-bezier(0.2, 0.75, 0.25, 1) forwards;
}

.tnt-marker.is-testing {
  animation: tnt-fuse-panic 90ms ease-in-out infinite alternate;
  filter: brightness(1.18) saturate(1.25);
}

.tnt-marker.is-misfiring {
  animation: tnt-misfire-collapse 430ms ease-out forwards;
}

.field.is-tnt-misfiring::after {
  content: "";
  position: absolute;
  z-index: 12;
  inset: -45%;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(circle at 38% 55%, rgba(225,229,226,.95) 0 12%, transparent 13%),
    radial-gradient(circle at 56% 42%, rgba(190,198,194,.92) 0 17%, transparent 18%),
    radial-gradient(circle at 67% 61%, rgba(146,154,150,.78) 0 14%, transparent 15%);
  animation: tnt-smoke-puff 430ms ease-out forwards;
}

@keyframes tnt-fuse-panic {
  from { transform: rotate(-7deg) scale(.98); }
  to { transform: rotate(7deg) scale(1.08); }
}

@keyframes tnt-misfire-collapse {
  0% { transform: scale(1); opacity: 1; filter: grayscale(0); }
  45% { transform: scale(.92, .72) rotate(-5deg); opacity: .85; filter: grayscale(.45); }
  100% { transform: scale(.2) rotate(12deg); opacity: 0; filter: grayscale(1); }
}

@keyframes tnt-smoke-puff {
  0% { transform: scale(.15); opacity: 0; filter: blur(0); }
  28% { opacity: .95; }
  100% { transform: scale(1.15) translateY(-12%); opacity: 0; filter: blur(2px); }
}

.tnt-marker.is-exploding .tnt-crate-label {
  animation: none;
}

.field.is-tnt-exploding::after {
  content: "";
  position: absolute;
  z-index: 7;
  inset: -65%;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(circle, #fff6bd 0 7%, #ffbd32 8% 18%, #e44922 19% 31%, rgba(72, 48, 37, 0.82) 32% 43%, transparent 66%);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform, opacity;
  animation: tnt-blast 620ms ease-out forwards;
}

@keyframes tnt-count {
  45% { transform: scale(1.4); background: #b52d1f; }
}

@keyframes tnt-idle-pulse {
  0%, 100% {
    transform: rotate(-4deg) scale(1);
    filter: brightness(1);
  }
  50% {
    transform: rotate(-3deg) scale(1.07);
    filter: brightness(1.12) saturate(1.08);
  }
}

@keyframes tnt-label-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 1px 0 rgba(66, 21, 12, 0.55);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 1px 0 rgba(66, 21, 12, 0.55), 0 0 5px rgba(255, 205, 93, 0.7);
  }
}

@keyframes tnt-crate-explode {
  0%, 18% { transform: rotate(-4deg) scale(1); opacity: 1; }
  28% { transform: rotate(8deg) scale(1.18); }
  48% { transform: rotate(-14deg) scale(0.82); opacity: 1; filter: brightness(1.7); }
  100% { transform: rotate(24deg) scale(0.15); opacity: 0; filter: brightness(0.5); }
}

@keyframes tnt-blast {
  0% { transform: scale(0.08) rotate(0); opacity: 0; }
  20% { opacity: 1; }
  62% { transform: scale(0.92) rotate(18deg); opacity: 0.9; }
  100% { transform: scale(1.25) rotate(28deg); opacity: 0; }
}

.piece {
  --piece-hue: 0deg;
  --piece-saturation: 1;
  --piece-brightness: 1;
  position: absolute;
  z-index: 4;
  inset: auto -13% -12%;
  display: grid;
  place-items: center;
  width: 126%;
  height: 146%;
  padding: 0;
  border: 0;
  border-radius: 42%;
  color: #fff;
  background: transparent;
  box-shadow: none;
  font-size: clamp(0.5rem, 1vw, 0.72rem);
  font-weight: 800;
  appearance: none;
  cursor: default;
  transition: transform 150ms ease, filter 150ms ease;
}

.piece::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: 25%;
  right: 25%;
  bottom: 4.5%;
  height: 9%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(27, 23, 18, 0.38) 0 30%, rgba(35, 29, 22, 0.22) 52%, transparent 76%);
  filter: blur(2px);
  opacity: 0.78;
  transform: scale(1);
  transform-origin: 50% 50%;
  pointer-events: none;
}

.pawn-sprite {
  --facing-scale: 1;
  position: absolute;
  z-index: 1;
  display: block;
  inset: 0;
  background-image: url("assets/pawn-idle-blue.webp");
  background-repeat: no-repeat;
  background-position: 0 50%;
  background-size: 100% 100%;
  filter:
    hue-rotate(var(--piece-hue))
    saturate(var(--piece-saturation))
    brightness(var(--piece-brightness))
    drop-shadow(0 3px 1px rgba(35, 27, 18, 0.32));
  transform: scaleX(var(--facing-scale));
  transform-origin: 50% 92%;
  transition: filter 150ms ease-in-out;
}

.piece[data-color="red"] { --piece-hue: 130deg; --piece-saturation: 1.18; --piece-brightness: 1.08; }
.piece[data-color="yellow"] { --piece-hue: 195deg; --piece-saturation: 1.35; --piece-brightness: 1.18; color: #302b18; }
.piece[data-color="green"] { --piece-hue: 265deg; --piece-saturation: 0.95; --piece-brightness: 0.92; }
.piece[data-color="blue"] { --piece-hue: 0deg; }

.piece.can-move {
  z-index: 7;
  cursor: pointer;
}

.field.has-placed-bomb > .piece:not(.is-moving-piece) {
  z-index: 6;
  bottom: -5%;
}

.field.is-tnt > .piece.is-sitting-on-tnt:not(.is-moving-piece) {
  z-index: 6;
  bottom: -5%;
}

.piece.is-sitting-on-bomb:not(.is-moving-piece) .pawn-sprite {
  inset: 0;
  background-image: url("assets/pawn-sit-bomb-blue.webp");
  background-position: 50% 50%;
  background-size: 100% 100%;
  filter: drop-shadow(2px 3px 1px rgba(35, 27, 18, 0.3));
  transform: none;
  transition: none;
}

.piece[data-color="red"].is-sitting-on-bomb:not(.is-moving-piece) .pawn-sprite {
  background-image: url("assets/pawn-sit-bomb-red.webp");
}

.piece[data-color="yellow"].is-sitting-on-bomb:not(.is-moving-piece) .pawn-sprite {
  background-image: url("assets/pawn-sit-bomb-yellow.webp");
}

.piece[data-color="green"].is-sitting-on-bomb:not(.is-moving-piece) .pawn-sprite {
  background-image: url("assets/pawn-sit-bomb-green.webp");
}

.piece.is-sitting-on-tnt:not(.is-moving-piece) .pawn-sprite {
  inset: 0;
  background-image: url("assets/pawn-sit-tnt-blue.webp");
  background-position: 50% 50%;
  background-size: 100% 100%;
  filter: drop-shadow(2px 3px 1px rgba(35, 27, 18, 0.3));
  transform: none;
  transition: none;
}

.piece[data-color="red"].is-sitting-on-tnt:not(.is-moving-piece) .pawn-sprite {
  background-image: url("assets/pawn-sit-tnt-red.webp");
}

.piece[data-color="yellow"].is-sitting-on-tnt:not(.is-moving-piece) .pawn-sprite {
  background-image: url("assets/pawn-sit-tnt-yellow.webp");
}

.piece[data-color="green"].is-sitting-on-tnt:not(.is-moving-piece) .pawn-sprite {
  background-image: url("assets/pawn-sit-tnt-green.webp");
}

.piece.is-sitting-on-bomb::before {
  bottom: 3%;
  transform: scale(.78, .72);
  opacity: .58;
}

.field.has-placed-bomb:has(> .piece.is-sitting-on-bomb) > .placed-bomb-marker {
  opacity: 0;
}

.field.is-tnt:has(> .piece.is-sitting-on-tnt) > .tnt-marker {
  opacity: 0;
}

.field.is-tnt:has(> .tnt-marker.is-testing) > .piece.is-sitting-on-tnt .pawn-sprite {
  animation: tnt-fuse-panic 90ms ease-in-out infinite alternate;
}

.bomb-placement-prop {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(1.3rem, 3vw, 2.35rem);
  pointer-events: none;
  animation: bomb-emerge-behind 470ms cubic-bezier(.2,.75,.2,1) both;
}

.piece.is-bomb-mounting {
  z-index: 8;
  animation: pawn-mount-bomb 470ms cubic-bezier(.25,.75,.2,1) both;
}

.tnt-placement-prop {
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
  background: transparent url("assets/tnt-item.png") 50% 50% / 82% 82% no-repeat;
  animation: bomb-emerge-behind 470ms cubic-bezier(.2,.75,.2,1) both;
}

.piece.is-tnt-mounting {
  z-index: 8;
  animation: pawn-mount-bomb 470ms cubic-bezier(.25,.75,.2,1) both;
}

.piece.is-tnt-mounting .pawn-sprite {
  animation: none;
  transition: none;
}

.piece.is-bomb-mounting .pawn-sprite {
  animation: none;
  transition: none;
}

.piece.is-bomb-dismounting .pawn-sprite {
  inset: 0;
  background-image: url("assets/pawn-idle-blue.webp");
  background-position: 0 50%;
  background-size: 100% 100%;
  animation: none;
}

.piece.is-tnt-dismounting .pawn-sprite {
  inset: 0;
  background-image: url("assets/pawn-idle-blue.webp");
  background-position: 0 50%;
  background-size: 100% 100%;
  animation: none;
}

@keyframes bomb-emerge-behind {
  0% { transform: translate(-38%, 8%) scale(.15); opacity: 0; }
  24% { transform: translate(-31%, 5%) scale(.72); opacity: 1; }
  62% { transform: translate(0, 2%) scale(1); opacity: 1; }
  76%, 100% { transform: translate(0, 2%) scale(1); opacity: 0; }
}

@keyframes pawn-mount-bomb {
  0% { transform: translateY(0) scale(1); }
  42% { transform: translateY(-42%) scale(.96, 1.04); }
  68% { transform: translateY(-24%) scale(1); }
  82% { transform: translateY(-4%) scale(1.02, .96); }
  100% { transform: translateY(0) scale(1); }
}

.piece.can-capture::after {
  content: "!";
  position: absolute;
  z-index: 12;
  top: -4%;
  right: -15%;
  display: grid;
  place-items: center;
  width: clamp(16px, 2.1vw, 24px);
  height: clamp(16px, 2.1vw, 24px);
  border: 2px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.28);
  font-size: clamp(0.5rem, 1vw, 0.72rem);
  font-weight: 900;
}

.field.has-playable {
  z-index: 6;
}

.field:where(:has(> .piece.is-sitting-on-bomb), :has(> .piece.is-sitting-on-tnt)) {
  z-index: 7;
}

.field.has-captured-piece {
  z-index: 60;
}

.field.has-moving-piece {
  z-index: 18;
}

.field:has(> .piece.is-bomb-mounting),
.field:has(> .piece.is-tnt-mounting),
.field:has(> .piece.is-bomb-dismounting),
.field:has(> .piece.is-tnt-dismounting) {
  z-index: 18;
}

.piece.is-moving-piece {
  transition: none;
  transform: none;
}

.piece.is-moving-piece .pawn-sprite {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0) scaleX(var(--facing-scale));
  will-change: transform, background-position, filter;
}

.piece.is-stepping {
  z-index: 9;
}

.piece.is-stepping::before {
  opacity: 0.75;
  animation: piece-shadow-walk-sync 560ms step-end infinite;
}

.piece.is-stepping .pawn-sprite {
  background-image: url("assets/pawn-walk-blue.webp");
  background-size: 800% 100%;
  animation: pawn-walk-cycle 560ms step-end infinite;
}

.piece.is-stepping.is-facing-down .pawn-sprite {
  background-image: url("assets/pawn-walk-down-blue.webp");
}

.piece.is-stepping.is-facing-up .pawn-sprite {
  background-image: url("assets/pawn-walk-up-blue.webp");
}

.piece.is-hover-raising .pawn-sprite,
.piece.is-hover-lowering .pawn-sprite {
  inset: -14.2857% -20.5882% 0;
  background-image: url("assets/pawn-hand-raise-blue.webp");
  background-size: 400% 100%;
  filter:
    hue-rotate(var(--piece-hue))
    saturate(var(--piece-saturation))
    brightness(var(--piece-brightness))
    drop-shadow(0 3px 1px rgba(35, 27, 18, 0.32));
}

.piece.is-hover-raising .pawn-sprite {
  animation: pawn-hover-raise 140ms step-end both;
}

.piece.is-hover-lowering .pawn-sprite {
  animation: pawn-hover-lower 140ms step-end both;
}

.piece.is-sitting-on-bomb:not(.is-moving-piece).is-hover-raising .pawn-sprite,
.piece.is-sitting-on-bomb:not(.is-moving-piece).is-hover-lowering .pawn-sprite {
  inset: -10% -17%;
  background-image: url("assets/pawn-sit-bomb-hand-raise-blue.webp");
  background-size: 400% 100%;
  filter: drop-shadow(2px 3px 1px rgba(35, 27, 18, 0.3));
}

.piece[data-color="red"].is-sitting-on-bomb:not(.is-moving-piece).is-hover-raising .pawn-sprite,
.piece[data-color="red"].is-sitting-on-bomb:not(.is-moving-piece).is-hover-lowering .pawn-sprite {
  background-image: url("assets/pawn-sit-bomb-hand-raise-red.webp");
}

.piece[data-color="yellow"].is-sitting-on-bomb:not(.is-moving-piece).is-hover-raising .pawn-sprite,
.piece[data-color="yellow"].is-sitting-on-bomb:not(.is-moving-piece).is-hover-lowering .pawn-sprite {
  background-image: url("assets/pawn-sit-bomb-hand-raise-yellow.webp");
}

.piece[data-color="green"].is-sitting-on-bomb:not(.is-moving-piece).is-hover-raising .pawn-sprite,
.piece[data-color="green"].is-sitting-on-bomb:not(.is-moving-piece).is-hover-lowering .pawn-sprite {
  background-image: url("assets/pawn-sit-bomb-hand-raise-green.webp");
}

.piece.is-sitting-on-tnt:not(.is-moving-piece).is-hover-raising .pawn-sprite,
.piece.is-sitting-on-tnt:not(.is-moving-piece).is-hover-lowering .pawn-sprite {
  inset: -10% -17%;
  background-image: url("assets/pawn-sit-tnt-hand-raise-blue.webp");
  background-size: 400% 100%;
  filter: drop-shadow(2px 3px 1px rgba(35, 27, 18, 0.3));
}

.piece[data-color="red"].is-sitting-on-tnt:not(.is-moving-piece).is-hover-raising .pawn-sprite,
.piece[data-color="red"].is-sitting-on-tnt:not(.is-moving-piece).is-hover-lowering .pawn-sprite {
  background-image: url("assets/pawn-sit-tnt-hand-raise-red.webp");
}

.piece[data-color="yellow"].is-sitting-on-tnt:not(.is-moving-piece).is-hover-raising .pawn-sprite,
.piece[data-color="yellow"].is-sitting-on-tnt:not(.is-moving-piece).is-hover-lowering .pawn-sprite {
  background-image: url("assets/pawn-sit-tnt-hand-raise-yellow.webp");
}

.piece[data-color="green"].is-sitting-on-tnt:not(.is-moving-piece).is-hover-raising .pawn-sprite,
.piece[data-color="green"].is-sitting-on-tnt:not(.is-moving-piece).is-hover-lowering .pawn-sprite {
  background-image: url("assets/pawn-sit-tnt-hand-raise-green.webp");
}

.piece.is-saluting .pawn-sprite {
  background-image: url("assets/pawn-salute-blue.webp");
  background-size: 600% 100%;
  animation: pawn-salute 360ms step-end both;
}

.piece.is-goal-saluting:not(.is-moving-piece) .pawn-sprite {
  background-image: url("assets/pawn-salute-blue.webp");
  background-size: 600% 100%;
  background-position: 60% 50%;
  animation: none;
}

.piece.is-goal-arriving .pawn-sprite {
  background-image: url("assets/pawn-salute-blue.webp");
  background-size: 600% 100%;
  animation: pawn-goal-arrival 300ms step-end both;
}

.piece.is-deploying .pawn-sprite {
  background-position: 14.2857% 50%;
  animation: none;
}

.piece.is-deploying::before {
  opacity: 0;
  animation: none;
}

.piece-flight-shadow {
  position: absolute;
  z-index: 1;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(27, 23, 18, 0.38) 0 30%, rgba(35, 29, 22, 0.22) 52%, transparent 76%);
  filter: blur(2px);
  pointer-events: none;
  will-change: transform, opacity;
}

.piece.is-facing-left .pawn-sprite {
  --facing-scale: -1;
}

.piece.is-turning-out .pawn-sprite {
  animation: piece-turn-out 150ms ease-in-out both;
}

.piece.is-turning-out::before {
  animation: piece-shadow-turn-out 150ms ease-in-out both;
}

.piece.is-turning-in .pawn-sprite {
  animation: piece-turn-in 180ms ease-in-out both;
}

.piece.is-turning-in::before {
  animation: piece-shadow-turn-in 180ms ease-in-out both;
}

.piece.is-captured {
  z-index: 21;
  animation: knocked-out 850ms linear forwards;
  pointer-events: none;
}

.piece.is-capture-attacker {
  z-index: 24;
}

.piece.is-capture-jumping .pawn-sprite {
  background-position: 0 50%;
  animation: none;
}

.piece.is-capture-jumping::before {
  animation: piece-shadow-capture-jump 620ms linear both;
}

.piece.is-capture-target {
  z-index: 23;
}

.piece-dizzy-stars {
  position: absolute;
  z-index: 28;
  top: -17%;
  left: 50%;
  width: 92%;
  height: 42%;
  pointer-events: none;
  transform: translateX(-50%);
  transform-origin: 50% 82%;
  animation: dizzy-stars-orbit 680ms linear both;
}

.piece-dizzy-stars i {
  position: absolute;
  display: block;
  color: #ffd326;
  font-style: normal;
  line-height: 1;
  text-shadow:
    -1px -1px 0 #7b4b00,
    1px -1px 0 #7b4b00,
    -1px 1px 0 #7b4b00,
    1px 1px 0 #7b4b00,
    0 2px 2px rgba(35, 25, 8, 0.42);
}

.piece-dizzy-stars i:nth-child(1) {
  top: 1%;
  left: 4%;
  font-size: 0.72rem;
}

.piece-dizzy-stars i:nth-child(2) {
  top: -15%;
  left: 43%;
  font-size: 0.95rem;
}

.piece-dizzy-stars i:nth-child(3) {
  top: 8%;
  right: 2%;
  font-size: 0.62rem;
}

.pawn-particle-layer {
  position: absolute;
  z-index: 70;
  inset: 0;
  overflow: visible;
  pointer-events: none;
  filter:
    hue-rotate(var(--particle-hue))
    saturate(var(--particle-saturation))
    brightness(var(--particle-brightness));
}

.pawn-particle {
  position: absolute;
  display: block;
  background-image: url("assets/pawn-idle-blue.webp");
  background-repeat: no-repeat;
  filter: drop-shadow(0 2px 1px rgba(35, 27, 18, 0.3));
  will-change: transform;
}

.piece:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

@keyframes pawn-walk-cycle {
  0% { background-position-x: 0%; }
  12.5% { background-position-x: 14.2857%; }
  25% { background-position-x: 28.5714%; }
  37.5% { background-position-x: 42.8571%; }
  50% { background-position-x: 57.1429%; }
  62.5% { background-position-x: 71.4286%; }
  75% { background-position-x: 85.7143%; }
  87.5% { background-position-x: 100%; }
  100% { background-position-x: 0%; }
}

@keyframes piece-shadow-walk-sync {
  0%, 50%, 100% { transform: scale(1, 1); }
  12.5%, 37.5%, 62.5%, 87.5% { transform: scale(0.985, 0.98); }
  25%, 75% { transform: scale(0.97, 0.96); }
}

@keyframes piece-shadow-capture-jump {
  0%, 10% {
    opacity: 0.78;
    transform: translateY(0) scale(1.02, 0.97);
  }
  22% {
    opacity: 0.7;
    transform: translateY(14px) scale(0.92);
  }
  50% {
    opacity: 0.5;
    transform: translateY(var(--capture-jump-height)) scale(0.72);
  }
  66% {
    opacity: 0.58;
    transform: translateY(var(--capture-head-lift)) scale(0.78);
  }
  69% {
    opacity: 0.64;
    transform: translateY(var(--capture-head-height)) scale(0.84, 0.8);
  }
  75% {
    opacity: 0.56;
    transform: translateY(var(--capture-rebound-lift)) scale(0.78);
  }
  86% {
    opacity: 0.68;
    transform: translateY(var(--capture-settle-lift)) scale(0.9);
  }
  100% {
    opacity: 0.78;
    transform: translateY(0) scale(1);
  }
}

@keyframes pawn-salute {
  0% { background-position-x: 0%; }
  14% { background-position-x: 20%; }
  28% { background-position-x: 40%; }
  42% { background-position-x: 60%; }
  58% { background-position-x: 60%; }
  72% { background-position-x: 80%; }
  88%, 100% { background-position-x: 100%; }
}

@keyframes pawn-hover-raise {
  0% { background-position-x: 0%; }
  34% { background-position-x: 33.3333%; }
  67% { background-position-x: 66.6667%; }
  100% { background-position-x: 100%; }
}

@keyframes pawn-hover-lower {
  0% { background-position-x: 100%; }
  34% { background-position-x: 66.6667%; }
  67% { background-position-x: 33.3333%; }
  100% { background-position-x: 0%; }
}

@keyframes pawn-goal-arrival {
  0% { background-position-x: 0%; }
  34% { background-position-x: 20%; }
  67% { background-position-x: 40%; }
  100% { background-position-x: 60%; }
}

@keyframes dizzy-stars-orbit {
  0% {
    opacity: 0;
    transform: translateX(-50%) rotate(0deg) scale(0.72);
  }
  14% {
    opacity: 1;
  }
  82% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) rotate(360deg) scale(1);
  }
}

@keyframes piece-turn-out {
  from {
    transform: rotate(0) scaleX(var(--facing-scale));
  }
  to {
    transform: rotate(var(--turn-out-angle, -3deg)) scaleX(var(--facing-scale));
  }
}

@keyframes piece-shadow-turn-out {
  from {
    opacity: 0.78;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0.78;
    transform: translateX(var(--turn-shadow-x, 0)) scale(0.97, 0.95);
  }
}

@keyframes piece-shadow-turn-in {
  0% {
    opacity: 0.78;
    transform: translateX(var(--turn-shadow-x, 0)) scale(0.97, 0.95);
  }
  68% {
    opacity: 0.78;
    transform: translateX(0.5%) scale(0.99, 0.98);
  }
  100% {
    opacity: 0.78;
    transform: translateX(0) scale(1);
  }
}

@keyframes piece-turn-in {
  0% {
    transform: rotate(var(--turn-in-angle, 3deg)) scaleX(var(--facing-scale));
  }
  68% {
    transform: rotate(-0.5deg) scaleX(var(--facing-scale));
  }
  100% {
    transform: rotate(0) scaleX(var(--facing-scale));
  }
}

@keyframes knocked-out {
  12% {
    transform: translate(var(--capture-hit-x), var(--capture-hit-y)) rotate(86.4deg) scale(1.06);
  }
  25% {
    transform: translate(var(--capture-quarter-x), var(--capture-quarter-y)) rotate(180deg) scale(1.03);
  }
  58% {
    opacity: 1;
    transform: translate(var(--capture-mid-x), var(--capture-mid-y)) rotate(417.6deg) scale(0.96);
  }
  88% {
    opacity: 1;
    transform: translate(var(--capture-x), var(--capture-y)) rotate(633.6deg) scale(0.96);
  }
  94% {
    transform: translate(var(--capture-x), calc(var(--capture-y) - 6px)) rotate(676.8deg) scale(1.025, 0.975);
  }
  100% {
    opacity: 1;
    transform: translate(var(--capture-x), var(--capture-y)) rotate(720deg) scale(1);
  }
}

.dice-area {
  --dice-accent: #777;
  position: relative;
  z-index: 1;
  grid-area: 6 / 6 / 7 / 7;
  place-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 92%;
  aspect-ratio: 1;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 18%;
  background: transparent;
  color: var(--ink);
  text-align: center;
  box-shadow: none;
  cursor: pointer;
  transition: transform 140ms ease;
  perspective: 180px;
}

.board[data-active-color="red"] .dice-area { --dice-accent: var(--red); }
.board[data-active-color="yellow"] .dice-area { --dice-accent: var(--yellow); }
.board[data-active-color="green"] .dice-area { --dice-accent: var(--green); }
.board[data-active-color="blue"] .dice-area { --dice-accent: var(--blue); }

.dice-area::before {
  content: "";
  position: absolute;
  inset: -7%;
  border: 3px solid var(--dice-accent);
  border-radius: 22%;
  box-shadow: 0 0 7px color-mix(in srgb, var(--dice-accent) 22%, transparent);
  pointer-events: none;
}

.board.pulse-sync .dice-area::before {
  opacity: 0.85;
  transform: scale(1.04);
}

.dice-area:hover {
  transform: scale(1.05);
}

.dice-area:disabled {
  filter: grayscale(0.7);
  cursor: not-allowed;
  opacity: 0.62;
}

.dice-area:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.dice-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.die {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  margin: 0;
  padding: 0;
  border: 0;
  background-image: url("assets/dice-3d.png");
  background-repeat: no-repeat;
  background-position: 0 50%;
  background-size: 600% 100%;
  filter: drop-shadow(0 3px 2px rgba(33, 30, 22, 0.3));
  transform-origin: 50% 58%;
  will-change: transform, filter;
}

.die i {
  display: none;
}

.die i.is-visible {
  display: none;
}

.dice-result {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.dice-area.is-actively-rolling .die {
  animation: dice-tumble 420ms linear infinite;
}

.dice-area.is-rolling .die {
  animation: dice-land 280ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

@keyframes dice-tumble {
  0% {
    transform: translate(-9%, 5%) rotateZ(-12deg) scale(0.94);
    filter: drop-shadow(5px 7px 3px rgba(33, 30, 22, 0.25));
  }
  17% {
    transform: translate(-3%, -11%) rotateZ(42deg) scale(1.03);
    filter: drop-shadow(2px 10px 4px rgba(33, 30, 22, 0.2));
  }
  34% {
    transform: translate(8%, -5%) rotateZ(104deg) scale(0.98);
    filter: drop-shadow(-4px 8px 3px rgba(33, 30, 22, 0.24));
  }
  52% {
    transform: translate(6%, 7%) rotateZ(176deg) scale(0.95);
    filter: drop-shadow(-5px 3px 2px rgba(33, 30, 22, 0.3));
  }
  70% {
    transform: translate(-5%, -8%) rotateZ(248deg) scale(1.02);
    filter: drop-shadow(4px 9px 4px rgba(33, 30, 22, 0.2));
  }
  86% {
    transform: translate(-8%, 4%) rotateZ(316deg) scale(0.96);
    filter: drop-shadow(5px 5px 3px rgba(33, 30, 22, 0.28));
  }
  100% {
    transform: translate(-9%, 5%) rotateZ(348deg) scale(0.94);
    filter: drop-shadow(5px 7px 3px rgba(33, 30, 22, 0.25));
  }
}

@keyframes dice-land {
  0% {
    transform: translateY(-9%) rotateZ(-16deg) scale(1.04);
  }
  46% {
    transform: translateY(4%) rotateZ(7deg) scale(1);
  }
  68% {
    transform: translateY(-3%) rotateZ(-3deg) scale(1.015);
  }
  84% {
    transform: translateY(1%) rotateZ(1deg) scale(1);
  }
  100% {
    transform: translateY(0) rotateZ(0) scale(1);
  }
}

.game-panel {
  position: sticky;
  top: 102px;
  display: grid;
  gap: 22px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 25px rgba(17, 24, 39, 0.08);
}

.turn-card {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.item-card {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.item-slot {
  position: relative;
  display: grid;
  grid-template-columns: 62px 1fr;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 76px;
  padding: 8px 12px;
  border: 1px solid #d9d4e5;
  border-radius: 12px;
  color: #35323c;
  background: linear-gradient(145deg, #fff, #f0ecf7);
  text-align: left;
  box-shadow: inset 0 1px 0 #fff, 0 4px 12px rgba(55,42,77,.1);
}

.item-slot:not(:disabled) {
  cursor: pointer;
  border-color: #7d62b2;
  box-shadow: 0 0 0 3px rgba(125,98,178,.14), 0 5px 14px rgba(55,42,77,.15);
}

.item-slot.is-targeting {
  border-color: #5f3c9d;
  background: linear-gradient(145deg, #fff, #e3d7ff);
  box-shadow: 0 0 0 4px rgba(125,98,178,.22), 0 6px 18px rgba(55,42,77,.2);
  animation: armed-item-pulse 680ms ease-in-out infinite alternate;
}

.item-slot.is-targeting::after {
  content: "ACTIVE";
  position: absolute;
  top: 6px;
  right: 7px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #fff;
  background: #6840aa;
  box-shadow: 0 2px 6px rgba(62, 35, 105, .28);
  font-size: .58rem;
  font-weight: 900;
  letter-spacing: .08em;
}

@keyframes armed-item-pulse {
  from { transform: scale(1); filter: brightness(1); }
  to { transform: scale(1.018); filter: brightness(1.08); }
}

.piece.is-item-target {
  filter: drop-shadow(0 0 5px rgba(116, 77, 190, .85));
}

.item-slot:disabled { opacity: .72; }

.item-slot:disabled[data-item]:not([data-item=""]) {
  opacity: .46;
  border-color: #b8b8b8;
  color: #666;
  background: linear-gradient(145deg, #eeeeee, #cfcfcf);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75), 0 2px 6px rgba(30,30,30,.08);
  filter: grayscale(.9) saturate(.18);
}

.item-slot:disabled[data-item]:not([data-item=""]) .item-icon {
  border-color: #dedede;
  background: radial-gradient(circle at 35% 25%, #f3f3f3, #b8b8b8 52%, #858585);
  box-shadow: 0 2px 0 #6f6f6f;
  filter: grayscale(1) contrast(.78) brightness(.9);
}

.item-slot strong { display: block; font-size: .95rem; }
.item-slot small { display: block; margin-top: 3px; color: #77717f; font-size: .7rem; }

.item-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 2px solid #fff;
  border-radius: 10px;
  background: radial-gradient(circle at 35% 25%, #fff, #d6c9ef 45%, #765ba8);
  box-shadow: 0 2px 0 #574272;
  font-size: 2rem;
}

.item-slot.is-rolling .item-icon { animation: item-roulette .11s linear infinite; }
@keyframes item-roulette { 50% { transform: scale(.88) rotate(-4deg); filter: brightness(1.25); } }

.item-projectile {
  position: absolute;
  z-index: 100;
  pointer-events: none;
  font-size: clamp(1rem, 2.6vw, 2.1rem);
  filter: drop-shadow(0 3px 2px rgba(0,0,0,.38));
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform, opacity;
}
.item-projectile.is-pistol { color: #181818; font-size: clamp(.65rem, 1.4vw, 1.1rem); }
.item-projectile.is-rocket::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 62%;
  left: 4%;
  width: 45%;
  height: 25%;
  border-radius: 50%;
  background: linear-gradient(90deg, rgba(255,76,20,0), #ff5a17 48%, #ffd84a);
  filter: blur(1px);
  animation: rocket-flame 90ms ease-in-out infinite alternate;
}
@keyframes rocket-flame {
  to { transform: scaleX(.62); opacity: .68; }
}
.selection-label {
  display: block;
  margin-bottom: 12px;
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.turn-card strong {
  display: block;
  font-family: "Inter", Arial, sans-serif;
  font-size: 1.65rem;
  letter-spacing: -0.035em;
  line-height: 1;
}

.turn-card strong[data-color="red"] { color: #bd211c; }
.turn-card strong[data-color="yellow"] { color: #947000; }
.turn-card strong[data-color="green"] { color: #187143; }
.turn-card strong[data-color="blue"] { color: #195f96; }

.turn-card p {
  min-height: 42px;
  margin: 12px 0 22px;
  color: #6b7280;
  font-size: 0.88rem;
  line-height: 1.5;
}

.player-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.player-list li {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.82rem;
}

.player-list li.is-current {
  background: var(--primary-light);
  font-weight: 800;
}

.player-name {
  font-weight: 800;
}

.player-list li[data-color="red"] .player-name { color: #bd211c; }
.player-list li[data-color="yellow"] .player-name { color: #947000; }
.player-list li[data-color="green"] .player-name { color: #187143; }
.player-list li[data-color="blue"] .player-name { color: #195f96; }

.player-score {
  display: grid;
  justify-items: end;
  gap: 3px;
  color: #6f6657;
  font-size: 0.7rem;
}

.player-item-status {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border: 1px solid #d8d0e4;
  border-radius: 999px;
  color: #51465e;
  background: #f4f0f8;
  font-size: .66rem;
  font-weight: 800;
  white-space: nowrap;
}

.player-item-status.is-used {
  color: #fff;
  border-color: #6944a5;
  background: #6944a5;
  animation: used-item-pop 700ms ease-out both;
}

.player-item-status.is-selected {
  color: #513183;
  border-color: #8f6dc3;
  background: #eadfff;
  animation: selected-item-pulse 680ms ease-in-out infinite alternate;
}

@keyframes selected-item-pulse {
  from { transform: scale(1); box-shadow: 0 0 0 rgba(111, 72, 170, 0); }
  to { transform: scale(1.035); box-shadow: 0 0 0 3px rgba(111, 72, 170, .14); }
}

@keyframes used-item-pop {
  0% { transform: scale(.72); opacity: 0; }
  45% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.secondary-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--primary);
  color: var(--primary-dark);
  background: #fff;
  text-align: center;
  text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.secondary-button:hover {
  border-color: var(--primary);
  color: #fff;
  background: var(--primary);
}

.panel-actions {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
}

.panel-actions .secondary-button {
  padding: 10px 14px;
  font-size: 0.78rem;
}

#newGame,
#leaveRoom {
  border-color: var(--primary-light);
  background: var(--primary-light);
}

#newGame:hover,
#leaveRoom:hover {
  border-color: var(--primary-dark);
  color: #fff;
  background: var(--primary-dark);
}

.sound-toggle {
  grid-column: 1;
  grid-row: 1;
  width: 42px;
  padding: 0 !important;
}

#newGame,
#leaveRoom {
  grid-column: 2;
  grid-row: 1;
}

.sound-icon {
  width: 21px;
  height: 21px;
  overflow: visible;
  fill: currentColor;
}

.sound-waves,
.sound-muted {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.sound-muted {
  display: none;
}

.sound-toggle[aria-pressed="false"] .sound-waves {
  display: none;
}

.sound-toggle[aria-pressed="false"] .sound-muted {
  display: block;
}

@media (min-width: 821px) {
  .page-shell {
    width: min(1100px, 92%);
    height: calc(100dvh - 58px);
    padding: 10px 0;
  }

  .game-area {
    width: 100%;
    height: 100%;
    grid-template-columns:
      minmax(0, min(calc(100dvh - 78px), calc(100% - 294px)))
      minmax(280px, 1fr);
    gap: 14px;
    align-items: start;
    justify-content: start;
  }

  .board-frame {
    width: min(100%, calc(100dvh - 78px));
    justify-self: start;
    aspect-ratio: 1;
  }

  .game-panel {
    position: static;
    width: 100%;
    height: min(100%, calc(100dvh - 78px));
    max-height: calc(100dvh - 78px);
    grid-template-rows: auto auto minmax(72px, 1fr) auto;
    gap: 12px;
    overflow: hidden;
  }

  .game-panel .turn-card,
  .game-panel .item-card {
    padding-bottom: 12px;
  }

  .game-panel .turn-card {
    order: 1;
    padding-bottom: 8px;
  }

  .game-panel .turn-card p {
    min-height: 0;
    margin: 8px 0 4px;
  }

  .game-panel .item-card {
    order: 2;
  }

  .game-panel .score-card {
    order: 3;
  }

  .game-panel .panel-actions {
    order: 4;
    position: relative;
    z-index: 2;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    background: #fff;
  }

  .game-panel .player-list {
    gap: 4px;
    margin-top: 7px;
  }

  .game-panel .player-list li {
    padding-block: 5px;
  }

}

@media (min-width: 821px) and (max-width: 1000px) {
  .game-area {
    grid-template-columns:
      minmax(0, min(calc(100dvh - 78px), calc(100% - 294px)))
      minmax(280px, 1fr);
  }
}

@media (min-width: 821px) and (max-height: 650px) {
  .game-panel {
    gap: 12px;
    padding: 14px;
  }

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

  .turn-card strong {
    font-size: 1.35rem;
  }

  .turn-card p {
    min-height: 0;
    margin: 7px 0 10px;
    font-size: 0.78rem;
  }

  .selection-label {
    margin-bottom: 7px;
  }

  .player-list {
    gap: 3px;
    margin-top: 6px;
  }

  .player-list li {
    padding: 4px 7px;
  }
}

@media (max-width: 820px) {
  .game-maedn.is-game-active .site-header-inner {
    width: min(100% - 20px, 1100px);
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
  }

  .game-maedn.is-game-active .site-brand {
    gap: .42rem;
  }

  .game-maedn.is-game-active .site-brand-logo {
    width: 24px !important;
    height: 24px !important;
    padding: 0;
  }

  .game-maedn.is-game-active .site-brand-name {
    font-size: .76rem;
  }

  .game-maedn.is-game-active .site-brand-title {
    display: inline;
  }

  .game-maedn.is-game-active .site-brand-name small {
    display: block;
    margin-top: .02rem;
    color: var(--site-muted);
    font-size: .48rem;
    font-weight: 700;
    letter-spacing: .09em;
  }

  .game-maedn.is-game-active .page-shell {
    width: min(100% - 20px, 1100px);
    padding: 6px 0 10px;
  }

  .game-area {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    gap: 8px;
  }

  .game-panel {
    position: static;
    width: 100%;
    height: auto;
    min-width: 0;
    min-height: 0;
    grid-template-columns: minmax(118px, .8fr) minmax(0, 1.2fr);
    grid-template-rows: auto auto auto;
    gap: 9px;
    order: 3;
    padding: 10px;
  }

  .game-panel .item-card {
    grid-column: 1;
    grid-row: 1;
    padding: 0;
    border: 0;
  }

  .game-panel .turn-card {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    padding: 2px 4px 0;
    border: 0;
  }

  .game-panel .score-card {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .game-panel .panel-actions {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .game-panel .turn-card > p {
    display: none;
  }

  .game-panel .selection-label {
    margin-bottom: 5px;
    font-size: .58rem;
  }

  .game-panel .turn-card strong {
    overflow: hidden;
    font-size: clamp(1.05rem, 4.7vw, 1.4rem);
    line-height: 1.08;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .game-panel .item-slot {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 7px;
    min-height: 48px;
    padding: 4px 7px;
    border-radius: 9px;
  }

  .game-panel .item-icon {
    width: 38px;
    height: 38px;
    border-radius: 7px;
    font-size: 1.35rem;
  }

  .game-panel .item-slot strong {
    overflow: hidden;
    font-size: .76rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .game-panel .item-slot small {
    display: none;
  }

  .game-panel .item-slot.is-targeting::after {
    top: -7px;
    right: -4px;
    padding: 2px 5px;
    font-size: .48rem;
  }

  .game-panel .player-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    margin-top: 4px;
  }

  .game-panel .player-list li {
    grid-template-columns: 9px minmax(0, 1fr) auto;
    column-gap: 9px;
    row-gap: 4px;
    min-width: 0;
    padding: 4px 6px;
    font-size: .7rem;
  }

  .game-panel .player-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .game-panel .player-score {
    font-size: .58rem;
  }

  .game-panel .player-score > span:first-child {
    display: none;
  }

  .game-panel .player-item-status {
    min-height: 17px;
    max-width: 92px;
    overflow: hidden;
    padding: 1px 5px;
    font-size: .56rem;
    text-overflow: ellipsis;
  }

  .panel-actions {
    grid-template-columns: 42px minmax(130px, 1fr);
  }
}

@media (max-width: 820px) and (orientation: landscape) and (min-width: 600px) {
  .game-maedn.is-game-active .page-shell {
    height: calc(100dvh - 38px);
    padding-block: 4px;
  }

  .game-area {
    grid-template-columns:
      minmax(0, min(calc(100dvh - 46px), calc(100% - 286px)))
      minmax(278px, 1fr);
    align-items: start;
    gap: 8px;
    height: 100%;
  }

  .board-frame {
    width: min(100%, calc(100dvh - 46px));
    aspect-ratio: 1;
  }

  .game-panel {
    height: min(100%, calc(100dvh - 46px));
    max-height: calc(100dvh - 46px);
    grid-template-columns: minmax(96px, .75fr) minmax(0, 1.25fr);
    gap: 6px;
    overflow: hidden;
    padding: 7px;
  }

  .game-panel .player-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .page-shell {
    width: min(100% - 20px, 1100px);
    padding: 4px 0 8px;
  }

  .board-frame {
    border-radius: 5px;
  }

  .board {
    border-radius: 1px;
  }

  .field {
    width: 82%;
    font-size: clamp(0.38rem, 2.1vw, 0.58rem);
  }

  .tnt-countdown {
    font-size: clamp(0.56rem, 2.8vw, 0.72rem);
  }

}

@media (prefers-reduced-motion: reduce) {
  .field,
  .dice-area,
  .piece {
    transition: none;
  }

  .dice-area.is-rolling .die {
    animation: none;
  }

  .dice-area::before {
    animation: none;
    opacity: 0.65;
  }

  .piece.can-move {
    animation: none;
  }

  .board[data-active-color] .home::after {
    animation: none;
  }

  .field.has-playable {
    animation: none;
  }

  .piece.is-stepping,
  .piece.is-captured {
    animation-duration: 1ms;
  }

  .piece.is-stepping::before,
  .piece.is-deploying::before {
    animation: none;
  }

  .tnt-countdown.is-counting,
  .tnt-marker.is-exploding,
  .field.is-tnt-exploding::after {
    animation-duration: 1ms;
  }

}

/* PawnBrawl visual theme */
:root {
  --ink: #10264b;
  --paper: #eaf7ff;
  --paper-light: #fff;
  --primary: #ff9100;
  --primary-dark: #092552;
  --primary-light: #d9f5ff;
  --line: #b7d8ed;
  --shadow: rgba(9, 37, 82, 0.2);
}

body.game-maedn {
  background:
    radial-gradient(circle at 7% 16%, rgb(255 190 0 / 16%) 0 5px, transparent 6px),
    radial-gradient(circle at 94% 32%, rgb(0 184 238 / 14%) 0 7px, transparent 8px),
    linear-gradient(135deg, transparent 0 48%, rgb(9 37 82 / 3%) 48% 52%, transparent 52%) 0 0 / 34px 34px,
    var(--paper);
}

.setup-overlay {
  background: rgb(9 37 82 / 82%);
}

.setup-card {
  border: 4px solid var(--primary-dark);
  border-radius: 24px;
  background: linear-gradient(160deg, #fff 0 62%, #edfaff 100%);
  box-shadow: 4px 5px 0 rgb(0 183 238 / 78%), 0 22px 58px rgb(0 0 0 / 24%);
}

.setup-game-logo {
  display: block;
  width: min(330px, 92%);
  height: auto;
  max-height: 150px;
  margin: -18px auto -2px 0;
  object-fit: contain;
  filter: drop-shadow(0 8px 5px rgb(9 37 82 / 24%));
  transform: translateX(-10.5%);
}

.room-lobby-card .setup-game-logo {
  transform: translateX(-18%);
}

.setup-card h2 {
  color: var(--primary-dark);
  font-weight: 900;
}

.eyebrow,
.selection-label,
.room-code-label {
  color: #e97800;
  font-weight: 900;
}

.count-field,
.tnt-option,
.room-player-list li {
  border: 2px solid var(--primary-dark);
  border-radius: 13px;
  background: #fff7cf;
  box-shadow: 2px 3px 0 rgb(9 37 82 / 12%);
}

.setup-options .count-field:nth-child(2) { background: #e1f8ff; }
.setup-options .count-field:nth-child(3) { background: #f0e8ff; }

.room-lobby-card .room-player-list li {
  border-color: #167446;
  background: linear-gradient(145deg, #efffe9, #bcefae);
  box-shadow: 2px 3px 0 #167446;
}

.room-lobby-card .room-player-list li small {
  color: #23643f;
}

.count-field select,
.player-inputs input {
  border: 2px solid var(--primary-dark);
  border-radius: 10px;
}

.count-field select {
  min-height: 44px;
  padding: 9px 48px 9px 12px;
  border-width: 3px;
  border-radius: 12px;
  color: var(--primary-dark);
  background-color: #fff;
  background-image:
    linear-gradient(45deg, transparent 50%, #fff 50%),
    linear-gradient(135deg, #fff 50%, transparent 50%),
    linear-gradient(180deg, #00bbed, #087cc2);
  background-position:
    calc(100% - 19px) 18px,
    calc(100% - 13px) 18px,
    right top;
  background-size: 6px 6px, 6px 6px, 38px 100%;
  background-repeat: no-repeat;
  box-shadow: 2px 3px 0 var(--primary-dark);
  font-weight: 900;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.count-field select:hover:not(:disabled) {
  background-color: #fff9d8;
  filter: saturate(1.08) brightness(1.03);
}

.count-field select:disabled {
  color: #69758a;
  background-color: #e7edf2;
  background-image:
    linear-gradient(45deg, transparent 50%, #fff 50%),
    linear-gradient(135deg, #fff 50%, transparent 50%),
    linear-gradient(180deg, #9aa9b8, #718296);
  cursor: not-allowed;
  opacity: 0.76;
}

.count-field select:focus,
.player-inputs input:focus {
  border-color: #00aee8;
  outline: 3px solid rgb(0 174 232 / 20%);
}

.count-field select:focus {
  box-shadow: 2px 3px 0 var(--primary-dark), 0 0 0 4px rgb(0 174 232 / 22%);
}

.color-dot {
  border: 2px solid var(--primary-dark);
  box-shadow: 1px 2px 0 rgb(9 37 82 / 22%);
}

.primary-button,
.secondary-button {
  border: 3px solid var(--primary-dark);
  border-radius: 12px;
  color: var(--primary-dark);
  background: linear-gradient(#ffd542, #ff9700);
  box-shadow: 2px 3px 0 var(--primary-dark);
  font-weight: 900;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.primary-button:hover,
.secondary-button:hover {
  border-color: var(--primary-dark);
  color: var(--primary-dark);
  background: linear-gradient(#ffe36a, #ffae1c);
  box-shadow: 1px 2px 0 var(--primary-dark);
  filter: saturate(1.08);
  transform: translate(2px, 2px);
}

.turn-overlay {
  background:
    radial-gradient(circle at center, rgb(0 183 238 / 20%), transparent 48%),
    rgb(9 24 56 / 92%);
}

.board-frame {
  padding: 0;
  border: 3px solid var(--primary-dark);
  border-radius: 22px;
  background: var(--primary-dark);
  box-shadow: 3px 4px 0 var(--primary-dark), 0 10px 18px rgb(9 37 82 / 12%);
}

.board {
  border: 3px solid var(--active-player-color);
  border-radius: 15px;
  background:
    radial-gradient(circle at 18% 20%, rgb(122 88 38 / 7%) 0 4px, transparent 5px),
    #eee1c5;
  box-shadow:
    inset 0 0 38px rgb(111 76 31 / 12%),
    inset 0 0 0 1px rgb(255 255 255 / 48%);
}

.board.is-awaiting-roll {
  animation: board-awaiting-roll 1.05s ease-in-out infinite;
}

.board.is-awaiting-roll .dice-area::before {
  animation: dice-awaiting-roll 1.05s ease-in-out infinite;
}

.item-slot.is-awaiting-roll-with-item {
  border-color: #7650bc;
  animation: item-awaiting-roll 1.05s ease-in-out infinite;
}

@keyframes board-awaiting-roll {
  0%, 100% {
    box-shadow:
      inset 0 0 38px rgb(111 76 31 / 12%),
      inset 0 0 0 1px rgb(255 255 255 / 48%),
      0 0 0 0 color-mix(in srgb, var(--active-player-color) 30%, transparent),
      0 0 8px color-mix(in srgb, var(--active-player-color) 35%, transparent);
  }
  50% {
    box-shadow:
      inset 0 0 38px rgb(111 76 31 / 12%),
      inset 0 0 0 1px rgb(255 255 255 / 48%),
      0 0 0 5px color-mix(in srgb, var(--active-player-color) 72%, transparent),
      0 0 24px color-mix(in srgb, var(--active-player-color) 72%, transparent);
  }
}

@keyframes dice-awaiting-roll {
  0%, 100% {
    border-width: 4px;
    box-shadow:
      0 0 0 1px rgb(255 255 255 / 90%),
      0 0 7px color-mix(in srgb, var(--dice-accent) 45%, transparent);
    opacity: 0.9;
    transform: scale(1);
  }
  50% {
    border-width: 5px;
    box-shadow:
      0 0 0 4px color-mix(in srgb, var(--dice-accent) 75%, transparent),
      0 0 22px color-mix(in srgb, var(--dice-accent) 90%, transparent);
    opacity: 1;
    transform: scale(1.12);
  }
}

@keyframes item-awaiting-roll {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgb(255 255 255 / 90%),
      0 0 7px rgb(118 80 188 / 45%);
  }
  50% {
    box-shadow:
      0 0 0 4px rgb(118 80 188 / 76%),
      0 0 22px rgb(118 80 188 / 88%);
  }
}

.field {
  border: max(2px, 0.13vw) solid var(--primary-dark);
  border-radius: 48% 52% 47% 53% / 52% 47% 53% 48%;
  outline: max(1px, 0.07vw) solid rgb(9 37 82 / 22%);
  outline-offset: max(-4px, -0.28vw);
  box-shadow:
    inset 0 2px 2px rgb(255 255 255 / 78%),
    1px max(2px, 0.2vw) 0 rgb(9 37 82 / 34%);
}

.field:nth-of-type(3n + 1) {
  border-radius: 53% 47% 51% 49% / 46% 54% 48% 52%;
  box-shadow:
    inset 1px 2px 2px rgb(255 255 255 / 76%),
    -1px max(2px, 0.18vw) 0 rgb(9 37 82 / 31%);
}

.field:nth-of-type(3n + 2) {
  border-radius: 46% 54% 49% 51% / 54% 48% 52% 46%;
  box-shadow:
    inset -1px 2px 2px rgb(255 255 255 / 74%),
    2px max(2px, 0.22vw) 0 rgb(9 37 82 / 36%);
}

.field-start,
.field-goal,
.field-house {
  border-width: max(2px, 0.16vw);
}

.home {
  opacity: 0.28;
  filter: saturate(1.15);
}

.home-yellow { border-radius: 47% 53% 49% 51% / 52% 46% 54% 48%; }
.home-green { border-radius: 53% 47% 51% 49% / 47% 54% 46% 53%; }
.home-red { border-radius: 49% 51% 46% 54% / 54% 48% 52% 46%; }
.home-blue { border-radius: 52% 48% 54% 46% / 49% 53% 47% 51%; }

.dice-area::before {
  border-width: 4px;
  background: rgb(255 255 255 / 62%);
  box-shadow: 2px 3px 0 rgb(9 37 82 / 20%);
}

.game-panel {
  border: 3px solid var(--primary-dark);
  border-radius: 20px;
  background: linear-gradient(165deg, #fff 0 65%, #e8f8ff 100%);
  box-shadow: 3px 4px 0 var(--primary-dark);
}

.turn-card,
.item-card,
.game-panel .panel-actions {
  border-color: rgb(9 37 82 / 18%);
}

.item-slot {
  border: 2px solid var(--primary-dark);
  background: linear-gradient(145deg, #fff, #efe7ff);
  box-shadow: 2px 3px 0 rgb(9 37 82 / 18%);
}

.player-list li.is-current {
  outline: 2px solid var(--primary-dark);
  background: #d9f5ff;
  box-shadow: 1px 2px 0 rgb(9 37 82 / 16%);
}

#newGame,
#leaveRoom {
  border-color: var(--primary-dark);
  color: var(--primary-dark);
  background: #d9f5ff;
}

@media (max-width: 600px) {
  .setup-card {
    border-width: 3px;
    border-radius: 18px;
    box-shadow: 3px 4px 0 rgb(0 183 238 / 72%);
  }

  .setup-game-logo {
    width: min(285px, 94%);
    margin-top: -10px;
  }

  .board-frame {
    padding: 0;
    border-width: 2px;
    border-radius: 16px;
    box-shadow: 2px 3px 0 var(--primary-dark);
  }

  .game-panel {
    border-radius: 16px;
    box-shadow: 2px 3px 0 var(--primary-dark);
  }
}

@media (prefers-reduced-motion: reduce) {
  .board.is-awaiting-roll,
  .board.is-awaiting-roll .dice-area::before,
  .item-slot.is-awaiting-roll-with-item {
    animation: none;
  }
}
