* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --page-bg: #12121a;
  --panel: #1b1b26;
  --panel-edge: rgba(255, 213, 74, 0.22);
  --gold: #ffd54a;
  --gold-deep: #c9930a;
  --ink: #ecebf3;
  --ink-soft: #b3b2c4;
  --ivory: #f6f1e4;
  --ivory-deep: #ddd5c2;
  --dial-ink: #2a2a3a;
  --orange: #ffa726;
  --green: #358038;
  --green-bright: #00ca09;
}

html {
  background: var(--page-bg);
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
  padding: 0 20px 40px;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 50% -8%, rgba(255, 213, 74, 0.16), transparent 65%),
    radial-gradient(600px 300px at 90% 110%, rgba(102, 126, 234, 0.12), transparent 60%),
    var(--page-bg);
}

.game-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 10px 0 20px;
}

/* The lock housing */
.container {
  position: relative;
  max-width: 640px;
  width: 100%;
  padding: 30px 28px 26px;
  border-radius: 22px;
  color: var(--ink);
  background:
    radial-gradient(600px 260px at 10% -10%, rgba(255, 213, 74, 0.14), transparent 60%),
    linear-gradient(160deg, #232333, var(--panel) 55%, #15151f);
  border: 1px solid var(--panel-edge);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 30px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

/* Faint dial ring in the corner, echoing the help panel */
.container::before {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  border: 14px solid rgba(255, 213, 74, 0.05);
  outline: 1px dashed rgba(255, 213, 74, 0.14);
  outline-offset: -44px;
  pointer-events: none;
}

header {
  position: relative;
  text-align: center;
  margin-bottom: 26px;
}

header h1 {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-family: "Bebas Neue", "Impact", "Segoe UI", sans-serif;
  font-size: clamp(2.4rem, 7vw, 3.2rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.06em;
}

/* Gradient only on the title text, not the buttons beside it */
header h1 .title-text {
  background: linear-gradient(180deg, #fff1b0 0%, var(--gold) 45%, var(--gold-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* How to play: the loudest control on the page after the board itself */
.help-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px 0 8px;
  border: none;
  border-radius: 999px;
  color: #2a1e00;
  background: linear-gradient(180deg, #fff1b0, var(--gold) 50%, var(--gold-deep));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 6px 18px rgba(255, 213, 74, 0.3);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.help-mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(42, 30, 0, 0.18);
  color: #2a1e00;
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1;
}

.help-label {
  font-family: "Bebas Neue", "Impact", sans-serif;
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  line-height: 1;
  padding-top: 2px;
}

.help-trigger:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 10px 24px rgba(255, 213, 74, 0.45);
}

.help-trigger:active {
  transform: translateY(1px);
}

/* A halo that pulses a few times on load, then leaves the player alone */
.help-trigger::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 2px solid var(--gold);
  opacity: 0;
  pointer-events: none;
  animation: helpPulse 1.8s ease-out 3;
}

@keyframes helpPulse {
  0%   { opacity: 0.9; transform: scale(1); }
  70%  { opacity: 0;   transform: scale(1.35); }
  100% { opacity: 0;   transform: scale(1.35); }
}

/* Share stays quiet so the help pill wins the eye */
.share-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.share-trigger:hover {
  color: var(--gold);
  background: rgba(255, 213, 74, 0.12);
  transform: translateY(-1px);
}

.help-trigger:focus-visible,
.share-trigger:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.share-trigger svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 560px) {
  /* Drop to a bold gold circle when the title needs the room */
  .help-label {
    display: none;
  }

  .help-trigger {
    padding: 0;
    width: 40px;
    justify-content: center;
  }

  .help-mark {
    width: 100%;
    height: 100%;
    background: none;
    font-size: 1.3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .help-trigger::after {
    animation: none;
  }
}

/* ---------------------------------------------------------------
   How to play: a dark vault panel with gold accents. Three steps,
   each with a tiny animated board showing the mechanic.
   --------------------------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1000;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal.show {
  display: block;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 30%, rgba(60, 50, 20, 0.55), rgba(8, 8, 14, 0.85));
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.modal-content.vault-panel {
  --vault-bg: #1b1b26;
  --vault-edge: rgba(255, 213, 74, 0.28);
  --gold: #ffd54a;
  --gold-deep: #c9930a;
  --ink: #ecebf3;
  --ink-soft: #b3b2c4;
  --orange: #ffa726;
  --green: #2fbf4f;

  position: relative;
  max-width: 660px;
  margin: 6vh auto;
  padding: 30px 32px 26px;
  border-radius: 18px;
  color: var(--ink);
  background:
    radial-gradient(700px 320px at 12% -10%, rgba(255, 213, 74, 0.18), transparent 60%),
    linear-gradient(160deg, #232333, var(--vault-bg) 55%, #15151f);
  border: 1px solid var(--vault-edge);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 30px 60px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

/* Engraved dial ring in the corner: pure decoration */
.modal-content.vault-panel::before {
  content: "";
  position: absolute;
  right: -70px;
  top: -70px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 14px solid rgba(255, 213, 74, 0.06);
  outline: 1px dashed rgba(255, 213, 74, 0.18);
  outline-offset: -40px;
  pointer-events: none;
}

.modal.show .vault-panel {
  animation: vaultOpen 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes vaultOpen {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

.vault-eyebrow {
  margin: 0 0 2px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

.vault-title {
  margin: 0 0 8px;
  font-family: "Bebas Neue", "Impact", "Segoe UI", sans-serif;
  font-size: clamp(2.2rem, 6vw, 3.1rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, #fff1b0 0%, var(--gold) 45%, var(--gold-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.vault-lede {
  margin: 0 0 22px;
  max-width: 46ch;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.5;
}

/* Steps */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.step {
  position: relative;
  padding: 16px 14px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  opacity: 0;
  transform: translateY(10px);
}

.modal.show .step {
  animation: stepIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.modal.show .step:nth-child(1) { animation-delay: 0.12s; }
.modal.show .step:nth-child(2) { animation-delay: 0.22s; }
.modal.show .step:nth-child(3) { animation-delay: 0.32s; }

@keyframes stepIn {
  to { opacity: 1; transform: none; }
}

.step-num {
  position: absolute;
  top: 10px;
  right: 12px;
  font-family: "Bebas Neue", "Impact", sans-serif;
  font-size: 1.6rem;
  line-height: 1;
  letter-spacing: 0.05em;
  color: rgba(255, 213, 74, 0.35);
}

.step-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 92px;
  margin-bottom: 12px;
}

.step-title {
  margin: 0 0 4px;
  font-family: "Bebas Neue", "Impact", sans-serif;
  font-size: 1.45rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--ink);
}

.step-text {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

/* Mini spinning column (step 1) */
.mini-col {
  width: 34px;
  height: 82px; /* exactly 3 tiles + 2 gaps */
  overflow: hidden;
  border-radius: 7px;
  border: 1px solid rgba(255, 213, 74, 0.3);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.5);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
}

.mini-strip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: miniSpin 3.6s steps(3, end) infinite;
}

.mini-tile {
  flex: 0 0 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: linear-gradient(145deg, #f8f8f8, #dcdce6);
  color: #2a2a3a;
  font-weight: 800;
  font-size: 0.85rem;
}

@keyframes miniSpin {
  from { transform: translateY(0); }
  to   { transform: translateY(-84px); }
}

.step-arrows {
  color: var(--gold);
  animation: nudge 1.2s ease-in-out infinite alternate;
}

@keyframes nudge {
  from { transform: translateY(-2px); }
  to   { transform: translateY(2px); }
}

/* Mini boards (steps 2 and 3) */
.mini-grid {
  display: grid;
  gap: 3px;
}

.mini-row {
  display: grid;
  grid-template-columns: repeat(5, 18px);
  gap: 3px;
}

.mini-row span {
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  color: #2a2a3a;
  background: linear-gradient(145deg, #f8f8f8, #dcdce6);
  border: 1px solid rgba(102, 126, 234, 0.55);
}

.mini-row span:first-child {
  border-color: transparent;
  box-shadow: inset 0 -3px 0 #00ca09;
}

.mini-row.half span {
  background: linear-gradient(145deg, #ffb74d, var(--orange));
  color: #fff;
  border-color: transparent;
}

.mini-row.full span {
  background: linear-gradient(145deg, #3ccf5d, #358038);
  color: #fff;
  border-color: transparent;
  box-shadow: none;
}

.modal.show .step:nth-child(3) .mini-row.full span {
  animation: rowLight 0.5s ease both;
}

.modal.show .step:nth-child(3) .mini-row:nth-child(1) span { animation-delay: 0.55s; }
.modal.show .step:nth-child(3) .mini-row:nth-child(2) span { animation-delay: 0.75s; }
.modal.show .step:nth-child(3) .mini-row:nth-child(3) span { animation-delay: 0.95s; }

@keyframes rowLight {
  from { filter: saturate(0.2) brightness(0.7); }
  to   { filter: none; }
}

.step-gold {
  filter: drop-shadow(0 0 6px rgba(255, 213, 74, 0.55));
}

.modal.show .step-gold {
  animation: goldDrop 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) 1.25s both;
}

@keyframes goldDrop {
  from { opacity: 0; transform: translateY(-10px) scale(0.6); }
  to   { opacity: 1; transform: none; }
}

/* Colour key chips inside captions */
.swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: -1px;
}

.swatch-half { background: var(--orange); }
.swatch-full { background: var(--green); }

/* Footer */
.vault-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 213, 74, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.vault-note {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--ink-soft);
  max-width: 34ch;
}

.modal-play {
  flex: 0 0 auto;
  padding: 12px 22px;
  border: none;
  border-radius: 999px;
  font-family: "Bebas Neue", "Impact", sans-serif;
  font-size: 1.15rem;
  letter-spacing: 0.1em;
  color: #2a1e00;
  background: linear-gradient(180deg, #fff1b0, var(--gold) 50%, var(--gold-deep));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 6px 18px rgba(255, 213, 74, 0.3);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.modal-play:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 10px 24px rgba(255, 213, 74, 0.45);
}

.modal-play:active {
  transform: translateY(1px);
}

.modal-play:focus-visible,
.modal-close:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  z-index: 1;
}

.modal-close:hover {
  color: var(--gold);
  background: rgba(255, 213, 74, 0.12);
}

@media (max-width: 600px) {
  .modal-content.vault-panel {
    margin: 12px;
    padding: 24px 18px 20px;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .step {
    display: grid;
    grid-template-columns: 96px 1fr;
    column-gap: 12px;
    align-items: center;
    padding: 12px;
  }

  .step-visual {
    grid-row: 1 / span 2;
    height: 84px;
    margin: 0;
  }

  .step-title {
    margin-top: 0;
  }

  .vault-footer {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .vault-note {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal.show .vault-panel,
  .modal.show .step,
  .mini-strip,
  .step-arrows,
  .modal.show .step:nth-child(3) .mini-row.full span,
  .modal.show .step-gold {
    animation: none;
  }

  .step {
    opacity: 1;
    transform: none;
  }
}

header p {
  color: var(--ink-soft);
  font-size: 1.1rem;
}

/* Gold bar vault: running tally of solved puzzles */
.vault {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px 6px 12px;
  border-radius: 999px;
  background: linear-gradient(145deg, #34344a, #22222f);
  color: var(--gold);
  border: 1px solid rgba(255, 213, 74, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 14px rgba(0, 0, 0, 0.35);
  user-select: none;
  -webkit-user-select: none;
}

.vault .gold-bar {
  width: 28px;
  height: 18px;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.4));
}

.gold-count {
  font-size: 1.15rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.gold-label {
  color: #c9c9d6;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1;
}

.vault.unlocked {
  animation: vaultBump 0.5s ease;
}

.vault.unlocked .gold-bar {
  animation: goldShine 0.8s ease;
}

@keyframes vaultBump {
  0% { transform: scale(1); }
  40% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

@keyframes goldShine {
  0% { filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.4)) brightness(1); }
  50% { filter: drop-shadow(0 0 8px rgba(255, 213, 74, 0.9)) brightness(1.5); }
  100% { filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.4)) brightness(1); }
}

.gold-pop {
  position: absolute;
  left: 50%;
  top: -4px;
  transform: translateX(-50%);
  color: #ffd54a;
  font-weight: 800;
  font-size: 1rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  animation: goldPop 1.2s ease-out forwards;
}

@keyframes goldPop {
  0% { opacity: 0; transform: translate(-50%, 0); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -36px); }
}

/* The lock plate the dials sit in */
.game-board {
  position: relative;
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 0 auto 22px;
  padding: 18px 14px;
  width: fit-content;
  border-radius: 18px;
  background: linear-gradient(180deg, #0f0f16, #16161f);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    inset 0 2px 10px rgba(0, 0, 0, 0.7),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04);
}

/* Four rivets in the plate corners */
.game-board::before,
.game-board::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  height: 6px;
  background:
    radial-gradient(circle at 3px 3px, rgba(255, 213, 74, 0.55) 0 2px, transparent 2.5px),
    radial-gradient(circle at calc(100% - 3px) 3px, rgba(255, 213, 74, 0.55) 0 2px, transparent 2.5px);
  pointer-events: none;
}

.game-board::before { top: 6px; }
.game-board::after  { bottom: 6px; }

.word-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  padding: 5px;
  border-radius: 14px;
}

.word-column:hover {
  background: rgba(255, 213, 74, 0.06);
  transform: translateY(-2px);
}

.word-column.dragging {
  background: rgba(255, 213, 74, 0.1);
  transform: scale(1.02);
  box-shadow: 0 8px 22px rgba(255, 213, 74, 0.18);
}

.word-column.locked-column {
  cursor: default;
}

.word-column.locked-column:hover {
  background: transparent;
  transform: none;
}

/* Dial tiles */
.letter-slot {
  width: 50px;
  height: 70px;
  background: linear-gradient(145deg, var(--ivory), var(--ivory-deep));
  border-radius: 10px;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.5), 0 4px 10px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.letter-slot:hover {
  transform: translateY(-2px);
}

.letter-slot.dragging {
  transform: scale(1.05);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 0 8px 16px rgba(0, 0, 0, 0.4);
}

.letter-slot.correct {
  background: linear-gradient(145deg, var(--green), var(--green));
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2),
    0 4px 8px rgba(76, 175, 80, 0.3);
}

.letter {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--dial-ink);
  transition: all 0.3s ease;
  text-align: center;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  pointer-events: none;
}

.letter-slot.correct .letter {
  background-color: var(--green-bright);
  color: white;
}

/* Half success - word found but not in correct position */
.letter-slot.half-correct {
  background: linear-gradient(145deg, #ffb74d, var(--orange));
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2),
    0 4px 14px rgba(255, 167, 38, 0.45);
}

.letter-slot.half-correct .letter {
  background-color: var(--orange);
  color: white;
}

/* Full success - word found in correct position */
.letter-slot.full-correct {
  background: linear-gradient(145deg, #3ccf5d, var(--green));
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2),
    0 4px 14px rgba(0, 202, 9, 0.4);
}

.letter-slot.full-correct .letter {
  background-color: var(--green-bright);
  color: white;
}

/* Dummy slots: the next dial letter peeking above and below */
.letter-slot.dummy-slot {
  opacity: 0.45;
  background: linear-gradient(145deg, #2a2a38, #1e1e2a);
  border: 1px dashed rgba(255, 213, 74, 0.3);
  box-shadow: none;
}

.letter-slot.dummy-slot .letter {
  color: var(--ink-soft);
  font-size: 1.5rem;
}

/* Playable slots */
.letter-slot.playable-slot {
  background: linear-gradient(145deg, var(--ivory), var(--ivory-deep));
  border: 1px solid rgba(255, 213, 74, 0.45);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.5),
    0 4px 10px rgba(0, 0, 0, 0.4);
}

.letter-slot.playable-slot:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.5),
    0 6px 16px rgba(255, 213, 74, 0.28);
}

/* The locked first column reads as brass */
.locked-column .letter-slot.playable-slot {
  background: linear-gradient(145deg, #fff1b0, #e9c65a);
  border-color: rgba(201, 147, 10, 0.6);
  cursor: default;
}

.locked-column .letter-slot.playable-slot:hover {
  transform: none;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.5),
    0 4px 10px rgba(0, 0, 0, 0.4);
}

.letter-slot.dragging .letter {
  color: #555;
  font-weight: 700;
}

/* Vertical scrolling animations with directional sliding */
.letter-slot.scrolling-up .letter {
  animation: slideOutDown 0.2s ease-out, slideInDown 0.2s ease-in 0.2s;
}

.letter-slot.scrolling-down .letter {
  animation: slideOutUp 0.2s ease-out, slideInUp 0.2s ease-in 0.2s;
}

@keyframes slideOutUp {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(-40px);
    opacity: 0;
  }
}

@keyframes slideInUp {
  0% {
    transform: translateY(40px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideOutDown {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  100% {
    transform: translateY(40px);
    opacity: 0;
  }
}

@keyframes slideInDown {
  0% {
    transform: translateY(-40px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.letter-slot.changing .letter {
  animation: letterChange 0.3s ease-in-out;
}

@keyframes letterChange {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.controls {
  /* display: flex; */
  display: none;
  gap: 15px;
  justify-content: center;
  margin-bottom: 20px;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 87, 108, 0.6);
}

.status {
  text-align: center;
}

.message {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 10px;
  min-height: 30px;
  color: var(--ink-soft);
}

.message.success {
  color: var(--gold);
}

.message.error {
  color: #ff6b6b;
}

.message.info {
  color: var(--orange);
}

.score {
  font-size: 1.1rem;
  color: var(--ink-soft);
  font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
  body {
    padding: 0 10px 30px;
  }

  .container {
    padding: 22px 16px 20px;
  }

  .letter-slot {
    width: 50px;
    height: 70px;
  }

  .letter {
    font-size: 1.5rem;
  }

  .word-column {
    gap: 8px;
  }

  .controls {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 200px;
  }
}

@media (max-width: 480px) {
  .game-board {
    gap: 5px;
    padding: 14px 10px;
  }

  .letter-slot {
    width: 45px;
    height: 60px;
  }

  .letter {
    font-size: 1.3rem;
  }

  .word-column {
    gap: 6px;
  }
}

/* Success animation */
@keyframes success {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.letter-slot.correct {
  animation: success 0.6s ease-in-out;
}

.green-underline {
  border-bottom: 4px solid var(--green-bright);
  border-radius: 2px;
  padding-bottom: 2px;
}

.hide-dummy {
  visibility: hidden !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}
