:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --ink: #1b1d1f;
  --muted: #62666b;
  --line: #e2e0d9;
  --accent: #0f7a5c;
  --accent-ink: #ffffff;
  --accent-soft: #e3f2ec;
  --danger: #b4321f;
  --warn-bg: #fff6e0;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(0,0,0,.05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131516;
    --surface: #1c1f21;
    --ink: #ecebe7;
    --muted: #9ea3a8;
    --line: #2d3134;
    --accent: #3fbf94;
    --accent-ink: #0c1512;
    --accent-soft: #17302a;
    --danger: #ef6f5c;
    --warn-bg: #2b2616;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; width: 100%; max-width: 980px; margin: 0 auto; padding: 8px 16px 32px; }
[hidden] { display: none !important; }

.top {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  max-width: 980px; width: 100%; margin: 0 auto; padding: 16px;
}
.brand { font-weight: 700; font-size: 20px; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.logo { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: 18px; }
.tag { color: var(--muted); font-size: 13px; }

h1 { font-size: clamp(24px, 4.2vw, 38px); line-height: 1.15; margin: 18px 0 10px; letter-spacing: -0.01em; text-wrap: balance; }
h2 { font-size: 22px; margin: 0 0 8px; }
h3 { font-size: 16px; margin: 0 0 12px; }
.lead { color: var(--muted); font-size: 17px; max-width: 640px; margin: 0 0 24px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

button, .btnlike {
  font: inherit; font-weight: 600; cursor: pointer;
  border: 0; border-radius: 10px; padding: 11px 18px;
  background: var(--accent); color: var(--accent-ink);
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px;
}
button:hover, .btnlike:hover { filter: brightness(1.06); }
button:disabled { opacity: .5; cursor: default; }
button.ghost, .btnlike.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.danger { background: transparent; color: var(--danger); border: 1px solid currentColor; }
button.small { padding: 6px 12px; min-height: 36px; font-size: 14px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.waitbox {
  display: grid; grid-template-columns: auto 1fr; gap: 36px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px; box-shadow: var(--shadow); margin-top: 8px;
}
.waitinfo h1 { margin: 0 0 6px; font-size: clamp(22px, 3.4vw, 32px); }
.qr { background: #fff; padding: 16px; border-radius: 14px; line-height: 0; width: 332px; height: 332px; }
.qr svg { width: 300px; height: 300px; display: block; }
.qrph { width: 300px; height: 300px; border-radius: 8px; background: repeating-linear-gradient(45deg, #eee 0 10px, #f6f6f6 10px 20px); animation: pulse 1.4s infinite; }
.codewrap { margin: 18px 0 4px; }
.code { font: 700 52px/1.1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .16em; }
.status { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 14px 0 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }
.linkbtn { background: none; color: var(--muted); padding: 0; min-height: 0; font-weight: 500; text-decoration: underline; font-size: 14px; }

.enter { margin-top: 16px; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: flex; gap: 12px 20px; align-items: center; flex-wrap: wrap; }
.enter label { font-weight: 600; display: flex; gap: 8px; align-items: center; }
.enterrow { display: flex; gap: 8px; flex: 1 1 240px; min-width: 0; }
#codeInput {
  flex: 1; min-width: 0; font: 600 22px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .15em;
  text-transform: uppercase; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
.toast { margin: 16px 0 0; padding: 12px 16px; border-radius: 10px; background: var(--accent-soft); font-weight: 600; }

.center { text-align: center; padding: 64px 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite; margin-bottom: 16px; }
@keyframes spin { to { transform: rotate(360deg) } }
.actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; justify-content: center; }
.big { font-size: 56px; color: var(--accent); line-height: 1; margin-bottom: 8px; }

.verify {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--accent-soft); border-radius: var(--radius); padding: 16px 20px; margin-top: 16px;
}
.verify > div { flex: 1; min-width: 200px; }
.vemoji { font-size: 44px; line-height: 1; }
.verify.lost { background: var(--warn-bg); }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.drop {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  border: 2px dashed var(--line); border-radius: 12px; padding: 26px 16px; cursor: pointer;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropico { font-size: 30px; color: var(--accent); line-height: 1; }

.list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; }
.item .row { display: flex; justify-content: space-between; gap: 2px 10px; align-items: center; flex-wrap: wrap; }
.item .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1 1 160px; }
.item .meta { color: var(--muted); font-size: 13px; flex: none; }
.bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s; }
.item .btns { display: flex; gap: 6px; flex-wrap: wrap; }
.item.err .meta { color: var(--danger); }

.note { color: var(--muted); font-size: 13px; margin-top: 18px; max-width: 760px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 16px; }

@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
  #vWait { display: flex; flex-direction: column; }
  .enter { order: -1; margin: 8px 0 16px; }            /* telefonda önce kod girişi */
  .waitbox { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; padding: 16px; gap: 14px; }
  .waitbox .status { justify-content: center; }
  .qr { width: min(232px, 100%); height: auto; padding: 12px; } .qr svg, .qrph { width: 100%; height: auto; aspect-ratio: 1; }
  .qrcol { width: 100%; display: flex; justify-content: center; }
  .enter { padding: 14px; }
  #codeInput { font-size: 20px; letter-spacing: .1em; }
  .code { font-size: 38px; }
}
@media (hover: none) { .hide-touch { display: none; } }
