:root {
  color-scheme: dark;
  --bg: #0c0a0d;
  --surface: #181318;
  --raised: #241b23;
  --line: #4b3745;
  --text: #fbf0f6;
  --muted: #c5aebb;
  --accent: #f4a0c9;
  --positive: #89e2b2;
  --notice: #ffca98;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(ellipse at 50% 0, #291723 0%, var(--bg) 61%);
  color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

main {
  width: min(calc(100% - 44px), 960px);
  margin: 0 auto;
  padding: max(30px, env(safe-area-inset-top)) 0 max(30px, env(safe-area-inset-bottom));
}

.topbar, .brand { display: flex; align-items: center; gap: 13px; }
.topbar { justify-content: space-between; padding-bottom: 19px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.brand strong { display: block; font-size: 1.3rem; letter-spacing: -.035em; line-height: 1.15; }
.brand-accent { color: var(--accent); }
.brand-caption { display: block; color: var(--muted); font-size: .79rem; margin-top: 2px; }

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: linear-gradient(145deg, #ffc1df, #e586bc);
  color: #291421;
  font-weight: 850;
  font-size: 1.4rem;
  padding-right: 4px;
}

.brand-mark span { position: absolute; right: 6px; top: 3px; font-size: .67rem; }
.demo { border: 1px solid #66475a; background: #352433; color: #ffd0e8; border-radius: 999px; padding: 4px 10px; font-size: .75rem; }

.workspace { display: grid; grid-template-columns: minmax(210px, 260px) minmax(0, 1fr); align-items: start; gap: 18px; }
.rental, .access, .payment-note, dialog { border: 1px solid var(--line); background: var(--surface); }
.rental { display: grid; gap: 14px; padding: 19px; border-radius: 20px; }
.rental-account, .rental-time { min-width: 0; }
.rental-time { padding-top: 12px; border-top: 1px solid var(--line); }
.label { display: block; color: var(--muted); font-size: .82rem; }
.rental strong { display: block; line-height: 1.2; margin-top: 4px; font-size: 1.55rem; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.rental-time strong { color: var(--accent); font-size: clamp(1.3rem, 4vw, 2.15rem); }
.rental button { width: 100%; }

.access {
  padding: clamp(22px, 4vw, 38px);
  border-radius: 24px;
  min-height: 345px;
  background: radial-gradient(ellipse at 100% 0%, #392638, transparent 70%), var(--surface);
}

.marker {
  width: 54px;
  height: 54px;
  margin-bottom: 16px;
  position: relative;
  border: 1px solid #69475c;
  border-radius: 16px;
  background: linear-gradient(var(--accent), var(--accent)) 50% 50% / 22px 2px no-repeat, #372438;
}
.marker::before, .marker::after { content: ""; position: absolute; left: 13px; right: 13px; height: 9px; border: 2px solid var(--accent); }
.marker::before { top: 13px; border-bottom: 0; border-radius: 4px 4px 0 0; }
.marker::after { bottom: 13px; border-top: 0; border-radius: 0 0 4px 4px; }

h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); line-height: 1.1; letter-spacing: -.045em; }
p { color: var(--muted); }
.step { margin-top: 15px; }
.step > p { margin-bottom: 14px; }

button, .secondary {
  font: inherit;
  font-weight: 720;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 8px 13px;
  cursor: pointer;
  text-decoration: none;
}

.primary { background: linear-gradient(135deg, #ffb9db, #e795c3); color: #291421; }
.secondary, .tabs button { background: var(--raised); border-color: var(--line); color: var(--text); }
#start { display: block; width: min(100%, 340px); min-height: 54px; font-size: 1.05rem; }
#idle .sample { display: inline-block; margin-bottom: 15px; }

button:focus-visible, a:focus-visible, input:focus-visible, .paste-zone:focus-visible, .choose:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (hover: hover) { button:hover, .choose:hover { filter: brightness(1.13); } }

.loading { color: var(--text); font-size: 1.35rem; font-weight: 730; }
.loading span { display: inline-block; width: 1.6ch; color: var(--accent); }
.tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tabs button { padding-inline: 7px; }
.tabs [aria-pressed=true] { border-color: #a57091; color: #ffd2e9; background: #422c40; }
.scan-panel { margin: 10px 0 12px; }
.camera-hint { margin-bottom: 10px; }
.paste-zone { display: grid; justify-items: center; gap: 8px; background: #211923; border: 1px dashed #83627a; border-radius: 16px; padding: 19px; text-align: center; }
.paste-zone span { color: var(--muted); font-size: .88rem; }
kbd { font: inherit; padding: 0 5px; border: 1px solid var(--line); border-radius: 4px; }
.choose { position: relative; display: inline-flex; align-items: center; }
.choose input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
a { color: #ffc1df; text-underline-offset: 4px; }
video { width: 100%; max-height: 330px; border-radius: 15px; background: var(--raised); }
.success { color: var(--positive); font-weight: 720; }
#feedback { margin-top: 12px; color: var(--notice); }

.payment-note { padding: 13px 15px; margin-top: 10px; border-radius: 15px; }
.payment-confirmed { display: grid; gap: 2px; border-color: #4e8269; background: #1a2924; }
.payment-confirmed strong { color: var(--positive); }

dialog { width: min(440px, 100% - 30px); border-radius: 21px; padding: 23px; color: var(--text); background: var(--raised); }
dialog::backdrop { background: #0c080cbf; }
dialog h2 { margin-bottom: 10px; font-size: 1.42rem; }
dialog input { display: block; margin-top: 7px; width: 100%; min-height: 44px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font: inherit; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }

@media (max-width: 640px) {
  main { width: calc(100% - 28px); padding-top: max(17px, env(safe-area-inset-top)); }
  .topbar { margin-bottom: 13px; padding-bottom: 13px; }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 11px; }
  .rental { grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 12px; border-radius: 16px; }
  .rental-time { padding: 0; border: 0; }
  .rental strong { font-size: 1.2rem; }
  .rental button { padding-inline: 9px; font-size: .86rem; }
  .access { min-height: 320px; border-radius: 19px; }
  #start { width: 100%; }
}

.qr-mark {
  padding: 0;
  flex: 0 0 44px;
}

.qr-mark i {
  position: relative;
  width: 23px;
  height: 23px;
  background:
    linear-gradient(currentColor, currentColor) top left / 8px 2px,
    linear-gradient(currentColor, currentColor) top left / 2px 8px,
    linear-gradient(currentColor, currentColor) top right / 8px 2px,
    linear-gradient(currentColor, currentColor) top right / 2px 8px,
    linear-gradient(currentColor, currentColor) bottom left / 8px 2px,
    linear-gradient(currentColor, currentColor) bottom left / 2px 8px,
    linear-gradient(currentColor, currentColor) bottom right / 8px 2px,
    linear-gradient(currentColor, currentColor) bottom right / 2px 8px;
  background-repeat: no-repeat;
}

.qr-mark i::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 5px;
  width: 3px;
  height: 3px;
  background: currentColor;
  box-shadow: 10px 0, 0 10px, 10px 10px, 6px 6px;
}

.status-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: clamp(24px, 6vw, 40px) clamp(16px, 4vw, 28px);
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #140f16;
  text-align: center;
}

.status-card--confirmed {
  border-color: #4e8269;
  background: radial-gradient(ellipse at 50% 0, #1f3c2f 0%, #111b17 72%);
  box-shadow: 0 14px 40px #06130d88;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: #2f2030;
  border: 1px solid #6b4a62;
  color: #ffd3ea;
}

.status-badge--ok {
  background: #1b3b2d;
  border-color: #539776;
  color: var(--positive);
}

.big-wait {
  margin: 0;
  font-size: clamp(2.15rem, 8.5vw, 3.6rem);
  font-weight: 850;
  line-height: 1.04;
  letter-spacing: -.02em;
  text-transform: uppercase;
  color: #ffffff;
}

.wait-lead {
  margin: 0;
  font-size: clamp(1.08rem, 3.6vw, 1.32rem);
  font-weight: 700;
  color: var(--text);
}

.status-card--confirmed .wait-lead {
  color: var(--positive);
}

.wait-note {
  margin: 0;
  max-width: 34ch;
  font-size: .95rem;
  color: var(--muted);
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  animation: valorent-pulse 1.4s ease-in-out infinite;
}

@keyframes valorent-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(.75); }
}

.error-text {
  color: var(--notice);
  font-weight: 650;
  margin-bottom: 16px;
}

.lang-switch {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.lang-switch button {
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 7px;
  font-size: .82rem;
  font-weight: 750;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
}

.lang-switch button[aria-pressed=true] {
  background: #422c40;
  border-color: #a57091;
  color: #ffd2e9;
}
