@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;700;900&family=Geist+Mono:wght@400;700;900&family=Noto+Sans+Thai:wght@400;700;900&display=swap');

:root {
  --pink: #EC008C;
  --grey: #B3B3B3;
  --ink: #141414;
  --paper: #FFFFFF;
  --line: rgba(255,255,255,0.14);

  /* Google Sans has no Thai glyphs; Noto Sans Thai sits right behind it
     in the same stack at a matching weight so the browser silently fills
     in any Thai characters without a visible seam. */
  --font-ui: 'Google Sans', 'Noto Sans Thai', sans-serif;
  --font-number: 'Geist Mono', monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-ui);
  font-weight: 700;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body { min-height: 100dvh; display: flex; flex-direction: column; }

a { color: inherit; }

/* ------------------------------------------------------------------ */
/* Header                                                              */
/* ------------------------------------------------------------------ */

.g-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) 18px 14px;
  padding-left: max(18px, env(safe-area-inset-left));
  padding-right: max(18px, env(safe-area-inset-right));
}

.g-brand { display: flex; align-items: center; gap: 10px; }
.g-brand img { height: 28px; width: auto; }
.g-brand span { font-size: 13px; letter-spacing: 0.08em; color: var(--grey); }

.g-login {
  appearance: none;
  text-decoration: none;
  border: 1px solid var(--line);
  color: var(--paper);
  background: rgba(255,255,255,0.06);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.g-login:active { background: rgba(255,255,255,0.14); }

/* ------------------------------------------------------------------ */
/* Display (Now Serving) view                                          */
/* ------------------------------------------------------------------ */

.g-main { flex: 1; display: flex; flex-direction: column; }

.display-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 20px calc(30px + env(safe-area-inset-bottom));
  gap: clamp(16px, 4vh, 32px);
  text-align: center;
}

.display-label {
  font-size: clamp(14px, 2.4vw, 20px);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--grey);
}

.display-number {
  font-family: var(--font-number);
  font-weight: 900;
  font-size: clamp(110px, 32vw, 320px);
  line-height: 1;
  color: var(--pink);
  transition: transform 0.25s ease;
}

.display-number.pulse { animation: pulse 0.6s ease; }
@keyframes pulse {
  0% { transform: scale(1); }
  30% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.display-sub {
  font-size: clamp(14px, 3vw, 20px);
  color: var(--paper);
  opacity: 0.75;
}
.display-sub b { color: var(--paper); opacity: 1; font-family: var(--font-number); }

.display-footer {
  font-size: 12px;
  color: var(--grey);
  letter-spacing: 0.05em;
  padding-bottom: env(safe-area-inset-bottom);
}

/* ------------------------------------------------------------------ */
/* Ticket-status ("/q/<id>") view                                      */
/* ------------------------------------------------------------------ */

.ticket-view {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px calc(30px + env(safe-area-inset-bottom));
}

.ticket-card {
  width: 100%;
  max-width: 420px;
  background: #1D1D1D;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px 24px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.ticket-card .tv-label {
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--grey);
  margin-bottom: 2px;
}

.ticket-card .tv-number {
  font-family: var(--font-number);
  font-weight: 900;
  font-size: clamp(70px, 22vw, 96px);
  line-height: 1;
  color: var(--pink);
  margin-bottom: 6px;
}

.tv-status {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  margin: 4px 0 18px;
  min-height: 1.5em;
}
.tv-status.turn { color: #35D07F; }
.tv-status.served { color: var(--grey); font-weight: 400; }
.tv-status.expired { color: var(--grey); font-weight: 400; }

.tv-divider {
  width: 100%;
  border-top: 1px dashed rgba(255,255,255,0.18);
  margin: 4px 0 18px;
}

.tv-now {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.tv-now .tv-now-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--grey);
}
.tv-now .tv-now-number {
  font-family: var(--font-number);
  font-weight: 900;
  font-size: clamp(30px, 8vw, 40px);
  color: var(--paper);
  transition: transform 0.25s ease;
}
.tv-now .tv-now-number.pulse { animation: pulse 0.6s ease; }

.ticket-card .tv-shop {
  margin-top: 20px;
  font-size: 12px;
  font-weight: 400;
  color: var(--grey);
  line-height: 1.6;
}

.tv-home-link {
  margin-top: 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--pink);
  text-decoration: none;
}

.tv-error {
  font-size: 15px;
  color: var(--grey);
  font-weight: 400;
  line-height: 1.6;
}

@media (max-width: 380px) {
  .g-brand span { display: none; }
}
