.snake-page {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: #e7efe1;
}
.snake-shell {
  width: 100%;
  max-width: none;
  height: 100dvh;
  min-height: 0;
  margin: 0;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.game-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 40px;
  padding: 0 9px;
  color: #24473c;
}
.game-title {
  font-size: 16px;
  white-space: nowrap;
}
.stage-label {
  font-size: 12px;
  color: #718675;
}
.game-score {
  margin-left: auto;
  font-size: 11px;
  white-space: nowrap;
}
.game-score b {
  margin-left: 7px;
  font-size: 18px;
  font-weight: 600;
}
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}
.toolbar-button {
  border: 1px solid #d1dfcd;
  background: #fafbf3;
  color: #3b6452;
  border-radius: 18px;
  padding: 7px 13px;
  font-size: 12px;
  white-space: nowrap;
}
.toolbar-button:hover {
  background: #f0f6e9;
}
.player-strip {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 30px;
  padding: 0 14px 3px;
  font-size: 11px;
}
.player-compact {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  white-space: nowrap;
}
.player-compact b {
  font-size: 11px;
  font-weight: 600;
}
.player-compact small {
  font-size: 9px;
  color: #82917f;
}
.player-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #74b982;
  flex: none;
}
.p2 .player-dot {
  background: #6babd2;
}
.health-track {
  height: 5px;
  width: 100px;
  border-radius: 6px;
  background: #d9e3d4;
  overflow: hidden;
  flex-shrink: 1;
}
.health-track i {
  height: 100%;
  width: 100%;
  display: block;
  background: #77b887;
}
.p2 .health-track i {
  background: #79b7d6;
}
.player-compact[data-health="low"] .health-track i { background: #c58a43; }
.player-compact[data-health="low"] .player-condition,
.player-compact[data-health="resting"] .player-condition { color: #835b30; font-weight: 600; }
.player-compact[data-health="resting"] .player-dot { background: #8b9188; }
.goal-label {
  margin-left: auto;
  color: #6b8167;
  white-space: nowrap;
}
.status-label {
  font-size: 10px;
  color: #86967f;
  white-space: nowrap;
}
.arena-section {
  flex: 1;
  min-height: 0;
  width: 100%;
  border: 1px solid #b8ceac;
  border-radius: 12px;
  overflow: hidden;
}
.arena-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #b4d2b1;
}
.arena-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  outline: none;
}
.arena-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #24493940;
  backdrop-filter: blur(5px);
  padding: 12px;
}
.start-card {
  background: #fdfbf3;
  text-align: center;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 15px 60px #36534430;
  max-width: 420px;
  width: 90%;
  padding-bottom: 24px;
}
.start-card img {
  height: 160px;
  width: 100%;
  object-fit: cover;
  object-position: 65% 65%;
}
.start-card h2 {
  font-size: 27px;
  font-weight: 500;
  margin: 22px 0 14px;
}
.start-card p {
  font-size: 12px;
  color: #78877d;
  margin-bottom: 22px;
}
.start-card small {
  display: block;
  font-size: 11px;
  margin-top: 18px;
  color: #78877d;
}
.pause-card {
  background: #fffaf0;
  border-radius: 24px;
  text-align: center;
  padding: 30px 36px;
}
.pause-card h2 {
  font-size: 28px;
  font-weight: 500;
  margin-top: 0;
}
.pause-card p {
  font-size: 13px;
  color: #78877d;
}
.outline-button {
  border: 1px solid #d4dfce;
  background: #f4f7ec;
  padding: 13px 19px;
  border-radius: 15px;
  color: #365744;
}
.tool-list {
  display: grid;
  gap: 10px;
  margin: 20px 0;
}
.tool-list .outline-button {
  margin: 0;
  width: 100%;
  text-align: left;
}
.menu-wallet {
  display: flex;
  justify-content: center;
  gap: 30px;
  font-size: 12px;
  color: #78877d;
}
.menu-wallet b {
  font-size: 18px;
  color: #285d4c;
  margin-left: 6px;
}
.help-details {
  text-align: left;
  border-top: 1px solid #dfe7dd;
  padding-top: 16px;
  font-size: 12px;
}
.help-details summary {
  cursor: pointer;
  color: #315c4b;
}
.help-details p {
  line-height: 1.8;
}
.growth-info {
  display: grid;
  gap: 8px;
  font-size: 11px;
  color: #78877d;
}
dialog {
  max-height: calc(100dvh - 24px);
  overflow: auto;
}
.site-message {
  bottom: 24px;
  pointer-events: none;
}
.start-card .start-message {
  background: #fff0d5;
  color: #795637;
  border-radius: 12px;
  padding: 12px;
  margin: 12px 0;
  line-height: 1.6;
}
.box-button {
  background: #e9dfc3;
}
@media (max-width: 900px) {
  .game-toolbar {
    gap: 9px;
    padding: 0 3px;
  }
  .stage-label,
  .status-label {
    display: none;
  }
  .player-strip {
    gap: 15px;
    padding: 0 8px 3px;
  }
  .goal-label {
    font-size: 10px;
  }
  .health-track {
    width: 70px;
  }
  .toolbar-button {
    padding: 6px 10px;
  }
}
@media (max-width: 600px) {
  .snake-shell {
    padding: 3px;
    gap: 3px;
  }
  .game-toolbar {
    gap: 5px;
    min-height: 36px;
  }
  .game-title {
    font-size: 12px;
  }
  .toolbar-button {
    font-size: 10px;
    padding: 6px 8px;
  }
  .game-score {
    font-size: 9px;
  }
  .game-score b {
    font-size: 14px;
    margin-left: 3px;
  }
  .player-strip {
    gap: 12px;
    justify-content: space-between;
    min-height: 27px;
    padding: 0 6px;
  }
  .goal-label,
  .player-compact small {
    display: none;
  }
  .player-compact {
    gap: 5px;
    font-size: 10px;
  }
  .player-compact[data-health="low"] .player-condition,
  .player-compact[data-health="resting"] .player-condition { display: inline; }
  .player-compact[data-health="low"] .health-track,
  .player-compact[data-health="resting"] .health-track { width: 30px; }
  .health-track {
    width: 55px;
  }
  .player-compact b {
    font-size: 10px;
  }
  .arena-section {
    border-radius: 9px;
  }
  .pause-card {
    padding: 22px;
  }
  .start-card {
    max-width: 350px;
  }
  .start-card img {
    height: 110px;
  }
  .start-card h2 {
    font-size: 23px;
  }
}
@media (max-height: 560px) {
  .start-card img {
    height: 80px;
  }
  .start-card {
    padding-bottom: 15px;
  }
  .start-card h2 {
    font-size: 22px;
    margin: 14px 0 10px;
  }
  .start-card p {
    margin-bottom: 14px;
  }
  .start-card small {
    margin-top: 12px;
  }
  .pause-card {
    padding: 20px 28px;
  }
}
dialog {
  width: min(520px, calc(100vw - 32px));
  border: 1px solid #e8e3cf;
  border-radius: 28px;
  background: #fffaf0;
  color: var(--ink);
  padding: 36px;
  text-align: center;
  box-shadow: 0 25px 80px #284c4440;
}
dialog::backdrop {
  background: #193d3659;
  backdrop-filter: blur(5px);
}
dialog h2 {
  font-size: 27px;
  font-weight: 500;
  margin: 10px 0 20px;
}
dialog p {
  font-size: 12px;
  color: var(--muted);
}
.dialog-close {
  position: absolute;
  right: 15px;
  top: 12px;
  background: none;
  border: 0;
  font-size: 26px;
  color: var(--muted);
  padding: 4px 10px;
}
.reward-row {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin: 30px 0;
  font-size: 11px;
  color: var(--muted);
}
.reward-row b {
  display: block;
  margin-top: 9px;
  font-size: 29px;
  color: var(--green);
  font-weight: 500;
}
dialog .outline-button {
  margin: 12px 0 0 8px;
}
.question-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 20px 0;
}
.question {
  padding: 13px 5px;
  background: #f1f3e9;
  border: 1px solid #e1e6d6;
  border-radius: 13px;
  font-size: 20px;
  color: var(--ink);
}
.question small {
  display: block;
  font-size: 9px;
  color: var(--muted);
  margin-bottom: 12px;
}
.lock-expression { white-space: nowrap; font-size: clamp(14px, 3.8vw, 20px); }
.lock-answer {
  display: block;
  width: 48px;
  height: 48px;
  margin: 12px auto 0;
  border: 2px solid #cddac9;
  border-radius: 12px;
  background: #fffef7;
  color: var(--green);
  text-align: center;
  font-size: 25px;
}
.lock-answer:focus {
  outline: 3px solid #d7c470;
  outline-offset: 2px;
  border-color: var(--green);
}
#passwordForm label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 10px;
}
#password {
  width: 100%;
  padding: 12px;
  border-radius: 13px;
  background: #fffef7;
  border: 1px solid #cddac9;
  text-align: center;
  letter-spacing: 14px;
  font-size: 25px;
  color: var(--green);
}
#password::placeholder {
  font-size: 13px;
  letter-spacing: 2px;
  color: #a6ada0;
}
#boxMessage,
#eggMessage {
  color: #a66c45;
  min-height: 20px;
}
.chest-picture,
.egg-picture {
  width: 100px;
  height: 100px;
  margin: 0 auto;
  background: url(assets/sprites.png) no-repeat;
  background-size: 300% 300%;
  background-position: 50% 100%;
}
.egg-picture {
  background-position: 100% 100%;
}
.box-hint {
  font-size: 10px;
  margin-top: 22px;
}
.muted {
  font-size: 11px;
  color: var(--muted);
}
.sudoku-grid {
  display: grid;
  max-width: 320px;
  margin: 24px auto;
  border: 2px solid #a5bd9d;
}
.sudoku-grid input {
  width: 100%;
  aspect-ratio: 1;
  text-align: center;
  background: #fffef7;
  border: 1px solid #dfe7d8;
  border-radius: 0;
  font-size: 22px;
  color: #4b8b83;
  min-width: 0;
}
.sudoku-grid input:read-only {
  background: #eef2e6;
  color: #385045;
}
#sudokuMessage {
  color: #a66c45;
}
.little-tip .text-button {
  padding: 5px 0;
  font-size: 11px;
  color: #417a68;
}

.sound-controls {
  display: grid;
  gap: 14px;
  margin: 16px 0 22px;
}
.sound-controls label {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  font-size: 12px;
}
.sound-controls input {
  width: 65%;
  accent-color: #5a9b73;
}
@media (max-width: 600px) {
  .game-title {
    display: none;
  }
}
