/* style.css - modern responsive styles */
:root{
  --bg:#0f1724;
  --card:#0b1220;
  --muted:#9aa4b2;
  --accent:#7c3aed; /* purple */
  --accent-2:#06b6d4; /* teal */
  --glass: rgba(255,255,255,0.04);
  --glass-2: rgba(255,255,255,0.02);
  --text:#e6eef8;
  --success:#22c55e;
  --danger:#ef4444;
  --radius:14px;
  --max-width:980px;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

/* Light theme (toggleable) */
:root[data-theme="light"]{
  --bg:#f4f7fb;
  --card:#ffffff;
  --muted:#6b7280;
  --accent:#6d28d9;
  --accent-2:#0891b2;
  --glass: rgba(0,0,0,0.03);
  --glass-2: rgba(0,0,0,0.02);
  --text:#0b1220;
  --success:#16a34a;
  --danger:#dc2626;
}

/* base */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  min-height:100vh;
  background: radial-gradient(1200px 600px at 10% 10%, rgba(124,58,237,0.12), transparent),
              radial-gradient(900px 500px at 90% 90%, rgba(6,182,212,0.06), transparent),
              var(--bg);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

/* layout */
.app-shell{display:flex;flex-direction:column;min-height:100vh}
.container{width:100%;max-width:var(--max-width);margin:18px auto;padding:16px}
.app-header{display:flex;align-items:center;justify-content:space-between;padding:18px 16px;margin:18px auto;max-width:var(--max-width);background:linear-gradient(180deg,var(--glass),transparent);border-radius:12px;backdrop-filter: blur(6px);box-shadow: 0 6px 18px rgba(2,6,23,0.6);}
.brand{display:flex;gap:12px;align-items:center}
.logo{width:56px;height:56px;border-radius:12px;background:linear-gradient(135deg,var(--accent),var(--accent-2));display:flex;align-items:center;justify-content:center;font-size:24px;box-shadow:0 8px 30px rgba(6,12,40,0.6)}
.title{margin:0;font-size:18px;letter-spacing:0.2px}
.subtitle{margin:0;font-size:13px;color:var(--muted)}

/* header actions */
.header-actions{display:flex;gap:8px;align-items:center}
.btn{background:transparent;border:0;color:var(--text);padding:8px 12px;border-radius:10px;cursor:pointer;font-weight:600}
.btn.primary{background:linear-gradient(90deg,var(--accent),var(--accent-2));color:white;box-shadow:0 6px 18px rgba(7,10,30,0.6)}
.btn.ghost{background:transparent;border:1px solid var(--glass);padding:8px}

/* main card */
.card{
  background: linear-gradient(180deg,var(--card), rgba(255,255,255,0.01));
  border-radius:var(--radius);
  padding:18px;
  box-shadow: 0 12px 40px rgba(2,6,23,0.6);
  overflow:visible;
}

/* game grid responsive */
.game-grid{display:grid;grid-template-columns: 1fr 360px; gap:18px}
@media (max-width:880px){ .game-grid{grid-template-columns: 1fr; } }

/* left box (game) */
.game-panel{padding:18px;border-radius:12px;background:linear-gradient(180deg,var(--glass),var(--glass-2));min-height:260px;display:flex;flex-direction:column;gap:12px}
.h2{font-size:20px;margin:0}
.small{font-size:13px;color:var(--muted)}

/* input area */
.form-row{display:flex;gap:10px;align-items:center}
input[type="text"], input[type="number"]{
  background:transparent;border:1px solid rgba(255,255,255,0.06);padding:12px 14px;border-radius:10px;color:var(--text);outline:none;font-size:15px;
  box-shadow: inset 0 -2px 6px rgba(0,0,0,0.2);
}
input::placeholder{color:var(--muted)}
input[type="number"]{width:120px}
.btn-wrap{display:flex;gap:8px;align-items:center}

/* leaderboard */
.leaderboard{padding:12px;border-radius:12px;background:linear-gradient(180deg,var(--glass),transparent);height:100%;display:flex;flex-direction:column}
.table-wrap{overflow:auto;border-radius:8px}
table{width:100%;border-collapse:collapse;font-size:14px}
th,td{padding:10px 12px;text-align:left}
th{background:rgba(255,255,255,0.02);font-weight:600;color:var(--muted);position:sticky;top:0}
tbody tr{background:linear-gradient(180deg, transparent, rgba(0,0,0,0.03));border-bottom:1px solid rgba(255,255,255,0.02)}
.rank{font-weight:700;padding-right:8px}

/* feedback badges */
.badge{display:inline-block;padding:8px 12px;border-radius:999px;font-weight:700}
.badge.success{background:linear-gradient(90deg, rgba(34,197,94,0.12), rgba(34,197,94,0.06));color:var(--success)}
.badge.warn{background:linear-gradient(90deg, rgba(245,158,11,0.08), rgba(245,158,11,0.04));color:#f59e0b}
.badge.error{background:linear-gradient(90deg, rgba(239,68,68,0.12), rgba(239,68,68,0.04));color:var(--danger)}

/* previous guesses list */
.guesses{display:flex;flex-wrap:wrap;gap:8px}
.guess-pill{background:rgba(255,255,255,0.03);padding:8px 10px;border-radius:999px;font-weight:600;color:var(--text)}

/* play again animation */
.play-again{display:inline-block;padding:10px 16px;border-radius:12px;background:linear-gradient(90deg,var(--accent),var(--accent-2));color:white;border:none;cursor:pointer;transform:translateY(0);transition:transform .18s ease, box-shadow .18s ease}
.play-again:hover{transform:translateY(-4px);box-shadow:0 14px 30px rgba(9,22,80,0.45)}

/* footer */
.app-footer{margin-top:auto;padding:18px 16px;text-align:center;color:var(--muted)}

/* confetti shapes (simple CSS confetti) */
#confetti-root{pointer-events:none;position:fixed;left:0;top:0;right:0;bottom:0;z-index:9999}
.confetti{
  position:absolute;width:10px;height:16px;opacity:0;transform-origin:center;will-change:transform,opacity;
  animation:confetti-fall 1500ms linear forwards;
  border-radius:2px;
}
@keyframes confetti-fall{
  0%{transform: translateY(-20vh) rotate(0deg) scale(1); opacity:1}
  60%{opacity:1}
  100%{transform: translateY(110vh) rotate(540deg) scale(.9); opacity:0}
}

/* small screens adjustments */
@media (max-width:480px){
  .logo{width:48px;height:48px;font-size:20px}
  .title{font-size:16px}
  input[type="number"]{width:100%}
  .game-grid{gap:12px}
  .leaderboard{order:2}
}

/* subtle entrance */
.container .card{animation:card-entrance .45s cubic-bezier(.2,.9,.3,1)}
@keyframes card-entrance{
  from{transform:translateY(8px);opacity:0}
  to{transform:none;opacity:1}
}
