:root {
  --bg: #1b0b24;
  --bg2: #2d1140;
  --card: rgba(255, 255, 255, 0.08);
  --card-strong: rgba(255, 255, 255, 0.14);
  --line: rgba(255, 255, 255, 0.16);
  --text: #fff7fb;
  --muted: #d9bfd6;
  --pink: #ff5fa2;
  --gold: #ffd166;
  --good: #2ec27e;
  --bad: #ff4d5e;
  --o0: #e63f5b;
  --o1: #2f7fe0;
  --o2: #e6a100;
  --o3: #25a15a;
  --radius: 18px;
  --react-bg: #f5b1b4; /* img/ecem/*.jpg arka plan rengi (resimlerden ölçüldü) */
  --font: 'Nunito', system-ui, sans-serif;
  --script: 'Dancing Script', cursive;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 85% -10%, rgba(255, 95, 162, 0.28), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(199, 125, 255, 0.25), transparent 60%),
    linear-gradient(160deg, var(--bg2), var(--bg));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.script { font-family: var(--script); font-weight: 700; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

.btn {
  border: 0;
  border-radius: 14px;
  padding: 0.8em 1.3em;
  font-weight: 800;
  background: var(--pink);
  color: #fff;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.25);
  transition: transform 0.08s, filter 0.15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.ghost { background: var(--card-strong); box-shadow: none; }
.btn.gold { background: var(--gold); color: #3a2400; }
.btn.danger { background: var(--bad); }
.btn.small { padding: 0.5em 0.9em; font-size: 0.9rem; }

.shape svg { width: 100%; height: 100%; fill: #fff; }
.o0 { --c: var(--o0); }
.o1 { --c: var(--o1); }
.o2 { --c: var(--o2); }
.o3 { --c: var(--o3); }

.local-banner, .conn-banner {
  position: fixed; left: 50%; transform: translateX(-50%);
  padding: 6px 14px; border-radius: 0 0 10px 10px; font-size: 12px; font-weight: 800;
  z-index: 100; top: 0;
}
.local-banner { background: var(--gold); color: #3a2400; }
/* Boyu ne olursa olsun (dar telefonda iki satır) tamamen gizli; sadece bağlantı gerçekten koparsa iner */
.conn-banner {
  background: var(--bad); color: #fff; width: max-content; max-width: calc(100vw - 24px); text-align: center;
  transform: translate(-50%, -110%); visibility: hidden; transition: transform 0.3s, visibility 0.3s;
}
.conn-banner.show { transform: translate(-50%, 0); visibility: visible; }

@keyframes pop { 0% { transform: scale(0.3); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pulse { 50% { opacity: 0.55; } }
@keyframes stamp { 0% { transform: scale(3) rotate(-12deg); opacity: 0; } 60% { transform: scale(0.9) rotate(-8deg); opacity: 1; } 100% { transform: scale(1) rotate(-8deg); opacity: 1; } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.pop { animation: pop 0.45s cubic-bezier(.2, .9, .3, 1.3) both; }
.rise { animation: rise 0.5s ease-out both; }

/* ============ TV ============ */
body.tv { height: 100vh; overflow: hidden; font-size: clamp(14px, 1.25vw, 28px); }
.tv #stage { position: absolute; inset: 0 0 3.6em 0; padding: 2.2em 3em 1em; display: flex; flex-direction: column; }
.tv #controls {
  position: fixed; left: 0; right: 0; bottom: 0; height: 3.6em;
  display: flex; align-items: center; gap: 0.6em; padding: 0 1.2em;
  background: rgba(0, 0, 0, 0.28); font-size: 0.8em;
}
.tv #controls .spacer { flex: 1; }
.tv #controls .hint { color: var(--muted); font-size: 0.85em; }
.tv #controls .btn { padding: 0.55em 1em; box-shadow: none; }

.lobby { flex: 1; display: grid; grid-template-columns: 1.35fr 1fr; gap: 3em; align-items: center; }
.kicker { text-transform: uppercase; letter-spacing: 0.25em; font-weight: 900; color: var(--gold); font-size: 0.9em; }
.lobby h1 { font-size: 4.6em; line-height: 1.05; margin: 0.2em 0 0.4em; }
.lobby .count { font-size: 1.3em; font-weight: 800; margin-bottom: 0.8em; }
.lobby .count b { color: var(--gold); font-size: 1.5em; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5em; max-height: 38vh; overflow: hidden; }
.chip {
  display: inline-flex; align-items: center; gap: 0.4em; padding: 0.45em 0.9em;
  border-radius: 999px; background: var(--card-strong); font-weight: 800; font-size: 1.15em;
}
.chip.bot { opacity: 0.7; border: 1px dashed var(--line); }
.chip.off { opacity: 0.4; }
.chip button { background: none; border: 0; padding: 0 0 0 0.2em; opacity: 0.5; }
.chip button:hover { opacity: 1; }
.lobby > div:last-child { display: flex; flex-direction: column; align-items: center; min-height: 0; }
.qr-card { width: min(100%, 50vh); background: #fff; color: #2d1140; border-radius: 28px; padding: 1.2em; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); }
.qr-card .qr svg { width: 100%; height: auto; display: block; }
.time-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4em; margin-top: 1.4em; font-weight: 800; }
.time-pick span { margin-right: 0.4em; color: var(--muted); }
.time-pick button { border: 2px solid var(--line); background: var(--card); border-radius: 999px; padding: 0.35em 0.9em; font-weight: 800; }
.time-pick button:hover { border-color: var(--gold); }
.time-pick button.on { background: var(--gold); border-color: var(--gold); color: #3a2400; }
.qr-card .label { font-weight: 900; font-size: 1.5em; margin-top: 0.4em; }
.qr-card .url { font-weight: 700; opacity: 0.7; word-break: break-all; }
.gelin-qr { width: min(100%, 50vh); display: flex; align-items: center; gap: 1em; margin-top: 1.2em; background: var(--card); border-radius: 18px; padding: 0.8em 1em; }
.gelin-qr .qr { width: 5.5em; background: #fff; border-radius: 10px; padding: 0.3em; flex: none; }
.gelin-qr .qr svg { width: 100%; height: auto; display: block; }
.gelin-qr b { font-size: 1.2em; }

.q-top { display: flex; align-items: center; justify-content: space-between; gap: 1em; }
.q-num { font-weight: 900; color: var(--gold); letter-spacing: 0.1em; text-transform: uppercase; }
.q-text { font-size: 3em; line-height: 1.15; margin: 0.35em 0 0.5em; text-align: center; font-weight: 900; }
.q-img { display: block; margin: 0 auto 0.8em; max-height: 30vh; max-width: 60%; border-radius: 16px; object-fit: contain; }
.timer { position: relative; width: 4.2em; height: 4.2em; flex: none; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 8; }
.timer .track { stroke: var(--card-strong); }
.timer .bar { stroke: var(--gold); stroke-linecap: round; transition: stroke-dashoffset 0.25s linear, stroke 0.3s; }
.timer.low .bar { stroke: var(--bad); }
.timer span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; font-size: 1.6em; }

.options { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8em; flex: 1; min-height: 0; align-content: stretch; }
.opt {
  position: relative; background: var(--c); border-radius: var(--radius); padding: 0.8em 1.1em;
  display: flex; flex-direction: column; justify-content: center; min-height: 0;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.22); transition: opacity 0.4s, transform 0.4s, filter 0.4s;
}
.opt .head { display: flex; align-items: center; gap: 0.7em; }
.opt .shape { width: 1.8em; height: 1.8em; flex: none; }
.opt .txt { font-size: 1.9em; font-weight: 900; line-height: 1.15; }
.opt .cnt { margin-left: auto; font-size: 2em; font-weight: 900; padding-left: 0.5em; }
.opt .voters { margin-top: 0.5em; display: flex; flex-wrap: wrap; gap: 0.3em; font-size: 0.95em; }
.opt .voters span { background: rgba(0, 0, 0, 0.22); padding: 0.15em 0.6em; border-radius: 999px; font-weight: 800; }
.opt.dim { opacity: 0.28; filter: grayscale(0.6); }
.opt.correct { transform: scale(1.02); box-shadow: 0 0 0 5px #fff, 0 10px 40px rgba(255, 255, 255, 0.25); }
.opt.correct::after { content: '✓'; position: absolute; top: -0.5em; right: -0.4em; background: #fff; color: var(--good); width: 1.6em; height: 1.6em; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 1.5em; }
.opt.selectable { cursor: pointer; }
.opt.selected { box-shadow: 0 0 0 5px var(--gold); }

.status-line { margin-top: 0.9em; display: flex; align-items: center; gap: 1em; flex-wrap: wrap; font-weight: 800; font-size: 1.1em; }
.status-line .big { font-size: 1.4em; color: var(--gold); }
.mini-chips { display: flex; flex-wrap: wrap; gap: 0.35em; }
.mini-chips span { padding: 0.2em 0.7em; border-radius: 999px; background: var(--card); font-size: 0.85em; opacity: 0.55; }
.mini-chips span.done { background: var(--good); opacity: 1; }
.banner { text-align: center; font-size: 1.7em; font-weight: 900; margin-top: 0.7em; }
.banner.wait { animation: pulse 1.4s infinite; }

.groom { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 1em; }
.groom .who { font-size: 3.2em; }
.groom .qsmall { color: var(--muted); font-size: 1.3em; max-width: 70%; }
.groom .opt { width: min(60vw, 900px); min-height: 5em; animation: rise 0.6s 0.4s both; }
.groom .verdict { font-size: 4em; font-weight: 900; padding: 0.15em 0.6em; border-radius: 16px; border: 6px solid currentColor; animation: stamp 0.5s 2.3s both; }
.groom .verdict.good { color: var(--good); }
.groom .verdict.bad { color: var(--bad); }
.groom .reaction { font-size: 4.2em; font-weight: 900; color: var(--gold); line-height: 1.1; max-width: 85%; animation: stamp 0.5s 1.2s both; }
.groom .reaction.late { font-size: 2.4em; animation-delay: 2.9s; }

.board { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.board h2 { font-size: 2.6em; margin: 0 0 0.5em; text-align: center; }
.rows { display: grid; gap: 0.45em; align-content: start; }
.rows.two { grid-template-columns: 1fr 1fr; column-gap: 1.5em; }
.board .rows.two .row { font-size: 1.05em; padding: 0.4em 0.9em; }
.row { display: grid; grid-template-columns: 2.2em 1fr auto; align-items: center; gap: 0.8em; background: var(--card); border-radius: 14px; padding: 0.5em 1em; font-size: 1.3em; font-weight: 800; animation: rise 0.4s both; }
.row .rank { color: var(--muted); font-weight: 900; }
.row .name { display: flex; align-items: center; gap: 0.5em; min-width: 0; }
.row .name i { font-style: normal; }
.row .bar { height: 0.5em; background: rgba(255, 255, 255, 0.12); border-radius: 99px; margin-top: 0.25em; overflow: hidden; }
.row .bar b { display: block; height: 100%; background: var(--pink); border-radius: 99px; }
.row .pts { font-size: 1.3em; font-weight: 900; }
.row .plus { color: var(--good); font-size: 0.75em; margin-left: 0.4em; }
.row.groom-row { background: linear-gradient(90deg, rgba(255, 209, 102, 0.3), rgba(255, 209, 102, 0.08)); box-shadow: inset 0 0 0 2px var(--gold); }
.row.groom-row .bar b { background: var(--gold); }

.final { flex: 1; display: flex; flex-direction: column; align-items: center; min-height: 0; }
.final h2 { font-size: 2.6em; margin: 0; }
.podium { display: flex; align-items: flex-end; gap: 1.5em; margin: 0.8em 0 0.8em; }
.podium .p { text-align: center; width: 12em; animation: rise 0.7s both; }
.podium .p .who { font-size: 1.6em; font-weight: 900; margin-bottom: 0.3em; }
.podium .p .who i { font-style: normal; display: block; font-size: 1.8em; }
.podium .p .block { border-radius: 16px 16px 0 0; display: grid; place-items: center; font-size: 3em; font-weight: 900; background: var(--card-strong); }
.podium .p1 .block { height: 2.6em; background: linear-gradient(var(--gold), #e0a800); color: #3a2400; }
.podium .p2 .block { height: 1.9em; background: linear-gradient(#e6e6f0, #a9a9c0); color: #2d2d45; }
.podium .p3 .block { height: 1.4em; background: linear-gradient(#e7a36b, #b56a2e); color: #3a1c00; }
.podium .p1 { animation-delay: 3s; }
.podium .p2 { animation-delay: 1.6s; }
.podium .p3 { animation-delay: 0.4s; }
.final .groom-line { font-size: 1.6em; font-weight: 900; text-align: center; animation: rise 0.6s 4.5s both; background: var(--card); padding: 0.6em 1.2em; border-radius: 16px; }
.final .rest { margin-top: 1em; width: min(80vw, 1300px); animation: rise 0.6s 5.2s both; overflow: hidden; min-height: 0; }
.final .rest .row { font-size: 0.95em; padding: 0.35em 0.9em; animation: none; }
.rows.three { grid-template-columns: 1fr 1fr 1fr; column-gap: 1em; }

.center-msg { flex: 1; display: grid; place-items: center; text-align: center; font-size: 1.6em; }

/* TV: cevap açıklanınca sağda Ecem'in tepki kartı */
.reveal-row { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr min(24vw, 42vh); gap: 0.8em; }
.reveal-row .options { height: 100%; }
.ecem-card {
  background: var(--react-bg); color: #3b1026; border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; min-height: 0; box-shadow: 0 8px 0 rgba(0, 0, 0, 0.22);
}
.ecem-card .bubble {
  position: relative; margin: 0.7em 0.7em 0; padding: 0.5em 0.8em; border-radius: 16px; background: #fff;
  font-weight: 900; font-size: 1.1em; line-height: 1.2; text-align: center; animation: pop 0.45s 0.6s both;
}
.ecem-card .bubble::after {
  content: ''; position: absolute; left: 50%; bottom: -0.6em; transform: translateX(-50%);
  border: 0.35em solid transparent; border-top: 0.4em solid #fff;
}
.ecem-card .photo-wrap { flex: 1; min-height: 0; width: 100%; margin: 0.6em 0 -30px; }
.ecem-card .react-img { height: 100%; object-fit: contain; object-position: 50% 100%; }
.groom .opt { width: min(50vw, 800px); }
.groom .reaction { max-width: 55vw; }
.groom-side { position: absolute; right: 2.5em; bottom: 1em; width: min(20vw, 34vh); height: 46vh; }
.groom-side .ecem-card { height: 100%; }
.ecem-card.late { animation: rise 0.6s 3.2s both; }
.ecem-card.late .photo-wrap.enter { animation-delay: 3.3s; }
.ecem-card.late .bubble { animation-delay: 3.9s; }
.final .award-line { font-size: 1.2em; font-weight: 800; margin-top: 0.6em; color: var(--muted); animation: rise 0.6s 5.2s both; }
.final .award-line b { color: var(--text); }
.final .rest { animation-delay: 5.8s; }

/* TV: emoji yağmuru */
#rain { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 60; }
.fly { position: absolute; bottom: 3.8em; display: flex; flex-direction: column; align-items: center; animation: fly 3.2s ease-out forwards; }
.fly span { font-size: 3.4em; line-height: 1; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35)); }
.fly small { margin-top: 0.2em; padding: 0.1em 0.5em; border-radius: 99px; background: rgba(0, 0, 0, 0.4); font-size: 0.8em; font-weight: 800; white-space: nowrap; }
.fly.gelin span { font-size: 5.5em; }
.fly.gelin small { background: var(--pink); }
@keyframes fly {
  0% { transform: translate(0, 0) scale(0.4); opacity: 0; }
  10% { transform: translate(0, -5vh) scale(1.15); opacity: 1; }
  40% { transform: translate(calc(var(--drift) * 0.4), -35vh) rotate(-10deg); }
  70% { transform: translate(calc(var(--drift) * 0.8), -60vh) rotate(8deg); opacity: 1; }
  100% { transform: translate(var(--drift), -85vh) rotate(0); opacity: 0; }
}

/* ============ TELEFON ============ */
body.phone { font-size: 17px; }
.wrap { max-width: 520px; margin: 0 auto; padding: 28px 16px 40px; min-height: 100vh; display: flex; flex-direction: column; }
.phone h1 { font-size: 2.3rem; line-height: 1.1; margin: 0.2em 0 0.3em; text-align: center; }
.phone .kicker { text-align: center; font-size: 0.75rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.field label { font-weight: 800; font-size: 0.9rem; color: var(--muted); }
.input {
  width: 100%; background: rgba(0, 0, 0, 0.25); border: 2px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font-size: 1.15rem; font-weight: 700; outline: none;
}
.input:focus { border-color: var(--pink); }
.big-btn { width: 100%; font-size: 1.2rem; padding: 16px; }
.me { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 800; margin-bottom: 14px; }
.me .tag { background: var(--card-strong); padding: 6px 12px; border-radius: 999px; }
.phone .q-num { font-size: 0.8rem; }
.phone .q-text { font-size: 1.45rem; margin: 10px 0 16px; }
.phone .q-img { max-width: 100%; max-height: 28vh; }
.ptimer { font-weight: 900; font-size: 1.1rem; background: var(--card-strong); padding: 4px 12px; border-radius: 999px; }
.ptimer.low { background: var(--bad); }
.answers { display: grid; gap: 12px; }
.ans {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  border: 0; border-radius: 16px; background: var(--c); padding: 18px 16px; min-height: 68px;
  font-size: 1.2rem; font-weight: 900; box-shadow: 0 6px 0 rgba(0, 0, 0, 0.25);
}
.ans .shape { width: 28px; height: 28px; flex: none; }
.ans:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25); }
.ans.on { box-shadow: 0 0 0 4px var(--gold), 0 6px 0 rgba(0, 0, 0, 0.25); }
.ans.off { opacity: 0.35; }
.ans:disabled { cursor: default; }
.state { text-align: center; padding: 26px 18px; border-radius: var(--radius); background: var(--card); }
.state .emoji { font-size: 3.4rem; line-height: 1; }
.state h2 { margin: 12px 0 6px; font-size: 1.6rem; }
.state p { margin: 6px 0; color: var(--muted); font-weight: 700; }
.state.good { background: rgba(46, 194, 126, 0.25); box-shadow: inset 0 0 0 2px var(--good); }
.state.bad { background: rgba(255, 77, 94, 0.2); box-shadow: inset 0 0 0 2px var(--bad); }
/* Ecem'in tepki resimli sonuç kartı: arka plan resimlerin pembesiyle aynı, resim kartın altına yaslı */
.state.photo, .state.photo.good, .state.photo.bad { background: var(--react-bg); color: #3b1026; padding: 22px 16px 0; overflow: hidden; }
/* Çerçeve border ile: resim içeride taşsa da çerçevenin üstüne binmez */
.state.photo.good { box-shadow: none; border: 4px solid var(--good); }
.state.photo.bad { box-shadow: none; border: 4px solid var(--bad); }
.state.photo h2 { margin-top: 0; }
.state.photo p { color: #6e2c47; }
/* Resim kartın altından 30px taşar (kart overflow:hidden ile keser); hoplayıp sallanırken altta boşluk açılmaz */
.photo-wrap { width: min(80vw, 300px); margin: 14px auto -30px; }
.photo-wrap.enter { animation: rise-up 0.7s cubic-bezier(.2, .9, .3, 1.2) both; }
.react-img {
  display: block; width: 100%; height: auto; transform-origin: 50% 100%;
  /* Yanlar ve üst kenar yumuşak: resmin sınırı kartta görünmesin */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent), linear-gradient(to bottom, transparent, #000 10%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent), linear-gradient(to bottom, transparent, #000 10%);
  mask-composite: intersect;
}
.react-img.dogru { animation: hop 0.9s 0.7s ease-in-out infinite; }
.react-img.yanlis { animation: sway 2.2s 0.7s ease-in-out infinite; }
@keyframes rise-up { from { transform: translateY(70%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-14px) rotate(-1.5deg); } 60% { transform: translateY(-14px) rotate(1.5deg); } }
@keyframes sway { 0%, 100% { transform: rotate(-2.5deg); } 50% { transform: rotate(2.5deg); } }
@media (prefers-reduced-motion: reduce) { .react-img, .photo-wrap.enter { animation: none !important; } }
.state.good .emoji { animation: pop 0.5s both; }
.state.bad .emoji { animation: shake 0.5s both; }
.chosen { display: inline-flex; align-items: center; gap: 8px; background: var(--c); padding: 8px 14px; border-radius: 12px; font-weight: 900; margin-top: 8px; }
.chosen .shape { width: 18px; height: 18px; }
.groom-note { margin-top: 14px; text-align: center; font-weight: 800; background: rgba(255, 209, 102, 0.15); border-radius: 14px; padding: 12px; }
.linkish { background: none; border: 0; color: var(--muted); text-decoration: underline; font-weight: 700; margin-top: 18px; }
.footer-note { margin-top: auto; padding-top: 24px; text-align: center; font-size: 0.8rem; color: var(--muted); }

/* Telefon: altta sabit emoji çubuğu */
.emoji-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; justify-content: center; gap: 6px;
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  background: rgba(27, 11, 36, 0.92); backdrop-filter: blur(8px); border-top: 1px solid var(--line);
}
.emoji-bar button { flex: 1; max-width: 54px; aspect-ratio: 1; border: 0; border-radius: 50%; background: var(--card-strong); font-size: 26px; line-height: 1; padding: 0; }
.emoji-bar button.sent { animation: tap 0.35s ease-out; }
@keyframes tap { 40% { transform: scale(1.35) translateY(-6px); } }
body.has-emoji-bar .wrap { padding-bottom: 96px; }

/* Telefon: final sertifikası */
.cert {
  position: relative; margin: 8px 4px 0; padding: 18px 16px 14px; border-radius: 14px; text-align: center;
  background: #fff8ec; color: #3b1026; animation: pop 0.6s both;
  box-shadow: 0 0 0 4px #fff8ec, 0 0 0 7px var(--gold), 0 18px 50px rgba(0, 0, 0, 0.4);
}
.cert::before { content: ''; position: absolute; inset: 8px; border: 1.5px solid #d9b25c; border-radius: 8px; pointer-events: none; }
.cert-kicker { letter-spacing: 0.3em; text-transform: uppercase; font-weight: 900; font-size: 0.75rem; color: #b8862b; }
.cert-icon { font-size: 2.2rem; margin-top: 4px; }
.cert-title { font-family: var(--script); font-weight: 700; font-size: 2rem; line-height: 1.1; color: #8a1d4a; margin: 2px 0 8px; }
.cert-given { font-size: 0.8rem; color: #8a6a78; font-weight: 700; }
.cert-name { display: inline-block; margin: 2px 0; padding: 0 10px 2px; border-bottom: 2px dotted #d9b25c; font-size: 1.5rem; font-weight: 900; }
.cert-score { margin-top: 8px; font-weight: 800; font-size: 0.95rem; }
.cert-stamp {
  position: absolute; top: 56px; right: 12px; padding: 4px 8px; border: 3px solid #c8102e; border-radius: 8px;
  background: rgba(255, 255, 255, 0.7); color: #c8102e; font-weight: 900; font-size: 0.8rem; animation: stamp 0.5s 0.9s both;
}
.cert-photo { display: flex; align-items: flex-end; justify-content: center; width: 72%; height: 170px; margin: 12px auto 0; border-radius: 12px; overflow: hidden; background: var(--react-bg); }
.cert-photo img { height: 118%; width: auto; margin-bottom: -18%; }
.cert-foot { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 10px; font-size: 0.75rem; color: #8a6a78; font-weight: 700; text-align: right; }
.cert-sign { font-family: var(--script); font-weight: 700; font-size: 1.6rem; color: #3b1026; border-top: 1.5px solid #3b1026; padding: 0 12px; line-height: 1.3; }
.cert-hint { text-align: center; font-weight: 800; margin-top: 18px; }

/* ============ ADMIN ============ */
body.admin { font-size: 15px; }
.admin .wrap { max-width: 900px; }
.admin h1 { font-size: 1.8rem; margin: 0; }
.admin h2 { font-size: 1.2rem; margin: 28px 0 12px; }
.warn-box { background: rgba(255, 209, 102, 0.15); border: 1px solid rgba(255, 209, 102, 0.5); border-radius: 12px; padding: 10px 14px; font-weight: 700; margin: 12px 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.qcard { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 14px; }
.qcard .qhead { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.qcard .qhead b { font-size: 1.1rem; margin-right: auto; }
.qcard textarea.input { font-size: 1rem; resize: vertical; min-height: 56px; }
.qcard .input { font-size: 1rem; padding: 9px 12px; }
.optrow { display: grid; grid-template-columns: 34px 1fr 150px; align-items: center; gap: 8px; margin-bottom: 8px; }
.optrow .letter { width: 34px; height: 34px; border-radius: 10px; background: var(--c); display: grid; place-items: center; font-weight: 900; }
.optrow label { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; font-weight: 800; color: var(--muted); cursor: pointer; white-space: nowrap; }
.optrow input[type=radio] { width: 18px; height: 18px; accent-color: var(--gold); }
.optrow.guess .input { border-color: var(--gold); }
.qmeta { display: grid; grid-template-columns: 1fr 120px; gap: 8px; margin-top: 6px; }
.qwarn { color: var(--gold); font-weight: 800; font-size: 0.85rem; margin-top: 6px; }
.savebar {
  position: sticky; bottom: 0; margin: 20px -16px 0; padding: 12px 16px;
  background: rgba(27, 11, 36, 0.92); backdrop-filter: blur(8px); border-top: 1px solid var(--line);
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.savebar .st { margin-right: auto; font-weight: 800; }
.savebar .st.dirty { color: var(--gold); }
.linkrow { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.linkrow b { width: 110px; flex: none; }
.linkrow code { flex: 1; background: rgba(0, 0, 0, 0.3); padding: 8px 10px; border-radius: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 640px) {
  .grid2, .qmeta { grid-template-columns: 1fr; }
  .optrow { grid-template-columns: 30px 1fr; }
  .optrow label { grid-column: 2; }
}
