:root{
  --bg:#121213;
  --panel:#1a1a1c;
  --text:#e8e8ea;
  --muted:#a7a7ad;
  --tile-border:#565758;

  --green:#2ecc71;
  --yellow:#f1c40f;
  --gray:#3a3a3c;
  --red:#e74c3c;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

*{box-sizing:border-box}
html,body{height:100%}
html, body{ -webkit-text-size-adjust: 100%; }

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background: radial-gradient(1200px 600px at 50% 0%, #1f1f22, var(--bg));
  color:var(--text);
}

.app{max-width:820px;margin:0 auto;padding:12px 14px 24px}

.topbar{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:10px 6px 12px;border-bottom:1px solid rgba(255,255,255,.08);
}

.brand{display:flex;align-items:center;gap:12px}
.title{margin:0;font-size:18px;letter-spacing:.14em}

.logo-slot{
  width:48px;height:48px;border-radius:14px;
  background: linear-gradient(135deg, rgba(231,76,60,.35), rgba(241,196,15,.25));
  border:1px solid rgba(255,255,255,.14);
  display:flex;align-items:center;justify-content:center;
  box-shadow: var(--shadow);
}
.logo-img{width:42px;height:42px;object-fit:contain;border-radius:12px}

.top-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}

.main{padding-top:12px}

.board-wrap{display:flex;flex-direction:column;align-items:center;margin:18px 0 10px}
.board{display:grid;grid-template-rows:repeat(6, 1fr);gap:8px;user-select:none}
.row{display:grid;grid-template-columns:repeat(5, 1fr);gap:8px}

.tile{
  width:56px;height:56px;border-radius:10px;
  background: var(--panel);
  border:2px solid var(--tile-border);
  display:flex;align-items:center;justify-content:center;
  font-weight:800;letter-spacing:.06em;font-size:28px;text-transform:uppercase;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  position:relative;
}
@media (max-width:420px){.tile{width:48px;height:48px;font-size:24px}}
.tile.filled{border-color:rgba(255,255,255,.22)}

.tile.correct{background: rgba(46,204,113,.9); border-color: rgba(46,204,113,.9); color: #0c1a10}
.tile.present{background: rgba(241,196,15,.92); border-color: rgba(241,196,15,.92); color: #1b1603}
.tile.absent{background: rgba(58,58,60,.92); border-color: rgba(58,58,60,.92); color: rgba(255,255,255,.92)}

.tile.correct::after{
  content:"";
  position:absolute;width:10px;height:10px;border-radius:999px;
  background: rgba(231,76,60,.9);
  transform: translate(16px, -18px);
  box-shadow: 0 0 0 3px rgba(0,0,0,.15);
}

/* Animations */
.shake{animation: shake .35s}
@keyframes shake{
  0%{transform:translateX(0)}
  20%{transform:translateX(-6px)}
  40%{transform:translateX(6px)}
  60%{transform:translateX(-4px)}
  80%{transform:translateX(4px)}
  100%{transform:translateX(0)}
}
.pop{animation: pop .12s}
@keyframes pop{
  0%{transform:scale(1)}
  50%{transform:scale(1.06)}
  100%{transform:scale(1)}
}
.flip{animation: flip .55s}
@keyframes flip{
  0%{transform: rotateX(0)}
  49%{transform: rotateX(90deg)}
  50%{transform: rotateX(90deg)}
  100%{transform: rotateX(0)}
}

.toast{min-height:22px;margin-top:10px;font-size:13px;color:rgba(255,255,255,.85)}
.toast .pill{
  display:inline-block;background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.12);
  border-radius:999px;padding:6px 10px;
}

/* Keyboard */
.keyboard-wrap{display:flex;justify-content:center;margin-top:10px}
.keyboard{display:flex;flex-direction:column;gap:8px;width:min(560px, 100%)}
.krow{display:flex;gap:6px;justify-content:center}
.key{
  flex:1;min-width:28px;height:48px;border-radius:12px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.92);
  font-weight:700;letter-spacing:.04em;cursor:pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.key.wide{flex:1.6}
.key:active{transform: translateY(1px)}
.key.correct{background: rgba(46,204,113,.9); color:#0c1a10; border-color: rgba(46,204,113,.9)}
.key.present{background: rgba(241,196,15,.92); color:#1b1603; border-color: rgba(241,196,15,.92)}
.key.absent{background: rgba(58,58,60,.92); color: rgba(255,255,255,.92); border-color: rgba(58,58,60,.92)}

.fineprint{margin-top:14px;color:rgba(255,255,255,.55);font-size:12px;text-align:center}

.btn{
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.92);
  border-radius:12px;padding:10px 12px;font-weight:700;cursor:pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.btn-small{padding:8px 10px;border-radius:10px;font-size:12px}
.btn-ghost{background: rgba(255,255,255,.06)}
.btn-danger{background: rgba(231,76,60,.18); border-color: rgba(231,76,60,.35)}
.btn-primary-red{
  background: linear-gradient(135deg, rgba(231,76,60,.98), rgba(192,57,43,.98));
  border-color: rgba(255,255,255,.14);
  color: #ffffff;
}

/* How-to bullets */
.bullets{margin:8px 0 0 18px;padding:0;color:rgba(255,255,255,.92)}
.bullets li{margin:6px 0;line-height:1.25}
.chip{
  display:inline-block;padding:2px 8px;border-radius:999px;font-size:12px;
  border:1px solid rgba(255,255,255,.14);vertical-align:middle
}
.chip-green{background: rgba(46,204,113,.25)}
.chip-yellow{background: rgba(241,196,15,.25)}
.chip-gray{background: rgba(58,58,60,.65)}

/* Modals */
.modal-backdrop{
  position:fixed;inset:0;background: rgba(0,0,0,.60);
  display:flex;align-items:center;justify-content:center;
  padding:16px;z-index:50;
}
.modal-backdrop[hidden]{display:none !important;}

.modal{
  width:min(560px, 100%);
  background:#161618;
  border:1px solid rgba(255,255,255,.12);
  border-radius:18px;
  box-shadow: var(--shadow);
  overflow:hidden;
  position:relative;
}
.modal-head{
  display:flex;align-items:center;justify-content:space-between;
  padding:12px;border-bottom:1px solid rgba(255,255,255,.10);
}
.modal-title{font-weight:900;letter-spacing:.02em}
.modal-body{padding:12px 12px 14px}

.prize-banner{
  border-radius:14px;padding:14px 12px;border:1px solid rgba(255,255,255,.12);
  background:
    radial-gradient(120px 60px at 20% 20%, rgba(231,76,60,.35), transparent 60%),
    radial-gradient(140px 80px at 80% 30%, rgba(241,196,15,.25), transparent 60%),
    rgba(255,255,255,.05);
  margin-bottom:12px;
}
.prize-big{font-weight:950;font-size:18px;margin-bottom:4px}
.prize-sub{color: rgba(255,255,255,.80); font-size: 13px}

/* Coupon */
.coupon{
  margin-top: 10px;
  border-radius: 16px;
  border: 1px dashed rgba(255,255,255,.22);
  background: rgba(255,255,255,.04);
  padding: 10px 12px;
  position: relative;
  overflow: hidden;
}
.coupon:before, .coupon:after{
  content:"";
  position:absolute;
  top: 50%;
  width: 26px; height: 26px;
  border-radius: 999px;
  background: #161618;
  border: 1px solid rgba(255,255,255,.10);
  transform: translateY(-50%);
}
.coupon:before{ left: -13px; }
.coupon:after{ right: -13px; }

.coupon-label{
  font-size: 12px;
  color: rgba(255,255,255,.75);
  margin-bottom: 6px;
  letter-spacing: .02em;
}
.coupon-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}
.coupon-code{
  font-weight: 950;
  letter-spacing: .14em;
  font-size: 18px;
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.10);
  padding: 10px 12px;
  border-radius: 14px;
  flex: 1;
  text-align:center;
}
.icon-btn{
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:active{ transform: translateY(1px); }

.redeem-mini{
  margin-top: 10px;
  color: rgba(255,255,255,.78);
  font-size: 13px;
  line-height: 1.25;
  display:flex;
  flex-direction:column;
  gap: 6px;
}

.cta-row{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.result-note{margin-top:10px;color: rgba(255,255,255,.70);font-size:12px;text-align:center}

/* Confetti */
.confetti{pointer-events:none;position:absolute;inset:0;overflow:hidden}
.confetti .piece{
  position:absolute;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  opacity: .95;
  animation: confetti-fall 1400ms linear forwards;
}
@keyframes confetti-fall{
  0%{ transform: translateY(-20px) rotate(0deg); opacity: 0; }
  10%{ opacity: 1; }
  100%{ transform: translateY(520px) rotate(420deg); opacity: 0; }
}

.btn-primary-green{
  background: linear-gradient(135deg, rgba(46,204,113,.95), rgba(39,174,96,.95));
  border-color: rgba(255,255,255,.14);
  color: #0c1a10;
}

/* Prize modal lock: no close button */
.modal-head.prize-lock{
  justify-content: center;
}
