:root {
  --bg: #1b1433;
  --bg2: #2a1f4f;
  --card: #ffffff;
  --ink: #2b2245;
  --muted: #7a6f99;
  --pink: #ff5d8f;
  --yellow: #ffd166;
  --green: #06d6a0;
  --red: #ef476f;
  --blue: #4cc9f0;
  --radius: 18px;
}
* { box-sizing: border-box; }
html { background: var(--bg2); }
.board > *, .actions > * { min-width: 0; }
[v-cloak] { display: none; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Fredoka', system-ui, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 20% 0%, #4b2d8f 0, transparent 45%),
              radial-gradient(circle at 90% 30%, #8f2d6b 0, transparent 40%),
              linear-gradient(var(--bg), var(--bg2));
  background-attachment: fixed;
  padding: 16px;
}
#app { max-width: 960px; margin: 0 auto; }
header { text-align: center; color: #fff; margin: 12px 0 20px; }
h1 { font-size: clamp(1.6rem, 5vw, 2.6rem); margin: 0; }
.sub { margin: 4px 0 12px; opacity: .8; }
h3 { margin: 0 0 8px; }
.loading { color: #fff; text-align: center; }

button {
  font: inherit; border: 0; border-radius: 12px; padding: 10px 16px; cursor: pointer;
  font-weight: 600; transition: transform .1s, opacity .2s;
}
button:active:not(:disabled) { transform: scale(.96); }
button:disabled { opacity: .45; cursor: not-allowed; }
.primary { background: var(--pink); color: #fff; }
.danger { background: var(--red); color: #fff; }
.ghost { background: rgba(255,255,255,.15); color: inherit; }
header .ghost { color: #fff; }

.card { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: 0 10px 30px rgba(0,0,0,.25); margin-bottom: 16px; }

.banner { border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; font-weight: 500; }
.banner small { display: block; opacity: .8; font-weight: 400; }
.happy { background: var(--yellow); }
.jail { background: #3a2f5c; color: #fff; }

.board { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
@media (max-width: 680px) { .board { grid-template-columns: 1fr; } .gallows svg { max-width: 180px; margin: 0 auto; display: block; } }
.gallows svg { width: 100%; }
.wood line { stroke: #8b5e34; stroke-width: 6; stroke-linecap: round; }
.man circle, .man line { stroke: var(--ink); stroke-width: 5; stroke-linecap: round; fill: none; animation: pop .4s ease; }
.face line { stroke: var(--red); stroke-width: 3; }
@keyframes pop { from { opacity: 0; transform: scale(.8); } }
.lives { text-align: center; font-size: 1.2rem; letter-spacing: 2px; }

.word { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 8px 0 20px; }
.slot {
  width: 42px; height: 52px; border-bottom: 4px solid var(--ink); display: grid; place-items: center;
  font-size: 1.8rem; font-weight: 700; background: #f3effc; border-radius: 8px 8px 0 0;
}
.slot.filled { color: var(--pink); animation: pop .4s ease; }
.gap { width: 24px; }
@media (max-width: 480px) { .slot { width: 30px; height: 40px; font-size: 1.3rem; } .gap { width: 12px; } }

.turn { text-align: center; padding: 10px; border-radius: 12px; background: #f3effc; margin-bottom: 14px; }
.turn.ready { background: #d8f8ee; }
.turn b { font-variant-numeric: tabular-nums; font-size: 1.2rem; }

.keyboard { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; }
.key { background: #ece6fb; color: var(--ink); padding: 10px 0; font-size: 1.1rem; }
.key.vowel { box-shadow: inset 0 -3px 0 var(--yellow); }
.key.selected { background: var(--pink); color: #fff; }
.key.hit { background: var(--green); color: #fff; opacity: 1; }
.key.miss { background: #d9d3e6; color: #a59cbf; text-decoration: line-through; opacity: 1; }

.confirm { margin-top: 14px; padding: 14px; border-radius: 12px; background: #fff3f7; border: 2px dashed var(--pink);
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; }
.confirm small { display: block; color: var(--muted); }
.confirm div { display: flex; gap: 8px; }
.confirm .ghost { background: #eee; }
.wrong { color: var(--muted); margin: 14px 0 0; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 680px) { .actions { grid-template-columns: 1fr; } }
.action { margin-bottom: 0; }
.action p { color: var(--muted); margin: 0 0 12px; }
.actions + .card, .actions { margin-bottom: 16px; }
.risk { display: flex; gap: 8px; }
.risk input { flex: 1; min-width: 0; font: inherit; padding: 10px 12px; border-radius: 12px; border: 2px solid #e2dcf2; }

.hints ol { margin: 0; padding-left: 22px; }
.hints li { margin: 6px 0; }
.hints .locked { color: var(--muted); list-style: none; margin-left: -22px; }
.messages p { margin: 8px 0; }
.messages small { color: var(--muted); display: block; }

.overlay { position: fixed; inset: 0; background: rgba(20,12,40,.75); display: grid; place-items: center; padding: 16px; z-index: 10; }
.overlay .card { max-width: 520px; width: 100%; }
.rules ul { padding-left: 0; list-style: none; }
.rules li { margin: 10px 0; }
.win .card { text-align: center; }
.win .big { font-size: 4rem; margin: 0; }
.win .name { font-size: clamp(1.8rem, 7vw, 2.8rem); font-weight: 700; color: var(--pink); margin: 8px 0; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); padding: 12px 20px; border-radius: 14px;
  color: #fff; font-weight: 600; z-index: 20; max-width: calc(100vw - 32px); text-align: center; animation: pop .3s ease; }
.toast.good { background: var(--green); }
.toast.bad { background: var(--red); }

.confetti { position: fixed; top: -10px; width: 10px; height: 14px; z-index: 30; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* Admin */
.admin table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.admin td { padding: 6px; border-bottom: 1px solid #eee; vertical-align: top; }
.admin .row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.admin input, .admin textarea { font: inherit; padding: 10px; border-radius: 12px; border: 2px solid #e2dcf2; width: 100%; }
.win .photo { width: min(260px, 60vw); aspect-ratio: 2 / 3; object-fit: cover; border-radius: 16px;
  border: 5px solid var(--yellow); box-shadow: 0 8px 24px rgba(0,0,0,.3); animation: reveal .9s ease; }
.win .card { max-height: calc(100vh - 32px); overflow-y: auto; }
@keyframes reveal { from { opacity: 0; transform: scale(.6) rotate(-8deg); filter: blur(12px); } }
