@font-face { font-family: Fahkwang; src: url(fonts/fahkwang-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-style: normal; font-display: block; }
@font-face { font-family: Fahkwang; src: url(fonts/fahkwang-latin-500-italic.woff2) format("woff2"); font-weight: 500; font-style: italic; font-display: block; }
@font-face { font-family: Fahkwang; src: url(fonts/fahkwang-latin-400-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: block; }
@font-face { font-family: Jost; src: url(fonts/jost-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: block; }
@font-face { font-family: Jost; src: url(fonts/jost-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: block; }
@font-face { font-family: Jost; src: url(fonts/jost-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: block; }
@font-face { font-family: Jost; src: url(fonts/jost-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: block; }

:root {
  /* The Cassette Club brand (tcc-homepage plugin): electric blue booth, lime buttons */
  --wood: #000b52;
  --frame: #001a9e;
  --frame-dark: #0a2bd0;
  --screen: #0027FF;
  --screen-dark: #001fd6;
  --card: #1d43ff;
  --cream: #DBDE52;      /* primary buttons = TCC lime */
  --btn-ink: #13221B;
  --ink: #FFFFFF;
  --accent: #DBDE52;
  --blue: #0027FF;
  --peri: #A9B6FF;
  --red: #e0564a;
  --line: rgba(255, 255, 255, 0.28);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--wood); overflow: hidden;
  font-family: Jost, "Segoe UI", system-ui, sans-serif; color: var(--ink); -webkit-font-smoothing: antialiased;
  user-select: none; -webkit-user-select: none; }
body { display: flex; align-items: center; justify-content: center; background: var(--wood); }

#device { width: min(96vw, 64vh); height: 94vh; background: var(--frame);
  border-radius: 32px; padding: 3.2vh 3vh 2vh; box-shadow: 0 20px 50px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.08);
  display: flex; flex-direction: column; }
#screen { flex: 1; background: var(--screen); border-radius: 26px; border: 1px solid var(--line);
  position: relative; overflow: hidden; padding: 4vh 3.4vh 2.4vh; }
.keys { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1vh; padding-top: 2vh; }
.keys span { height: 1.2vh; border-radius: 99px; background: rgba(255,255,255,.12); }
.keys span.red { background: var(--accent); }

.view { display: none; height: 100%; flex-direction: column; }
.view.active { display: flex; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }
.hidden { display: none !important; }

h1 { font-family: Fahkwang, Georgia, serif; font-weight: 500; font-size: 5.6vh; line-height: 1.05; letter-spacing: -0.02em; margin: 2vh 0 1vh; text-align: center; }
h1 em { font-weight: 400; color: var(--accent); }
h2 { font-family: Fahkwang, Georgia, serif; font-size: 3.6vh; margin: 0 0 2.4vh; text-align: center; font-weight: 500; letter-spacing: -0.01em; }
.tagline, .steps, .hint { text-align: center; opacity: .8; }
.steps { font-size: 1.8vh; margin-top: 3vh; }
.hint { font-size: 1.9vh; }
.big-text { font-size: 2.6vh; text-align: center; line-height: 1.4; }
.timer { position: absolute; top: 1.6vh; right: 2.4vh; font-size: 1.7vh; opacity: .75; font-variant-numeric: tabular-nums; }

.welcome { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.4vh; }
.tape-icon { width: 26vh; height: 16vh; border: 4px solid var(--ink); border-radius: 14px; display: flex;
  justify-content: center; gap: 5vh; align-items: center; position: relative; }
.tape-icon::after { content: ""; position: absolute; bottom: 1.4vh; left: 22%; right: 22%; height: 3.4vh;
  border: 3px solid var(--ink); border-bottom: 0; border-radius: 8px 8px 0 0; }
.reel { width: 5vh; height: 5vh; border-radius: 50%; border: 4px dashed var(--ink); animation: spin 3s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn { font: inherit; font-size: 2.3vh; min-height: 6.4vh; padding: 0 4vh; border-radius: 999px; border: 1px solid var(--cream);
  background: var(--cream); color: var(--btn-ink); font-weight: 600; cursor: pointer; }
.btn.ghost { border-color: rgba(255,255,255,.3); }
.btn:disabled { opacity: .35; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.big { font-size: 2.8vh; min-height: 8vh; padding: 0 7vh; margin-top: 3vh; }
.btn.small { font-size: 1.7vh; min-height: 4.4vh; padding: 0 2.4vh; }
.btn:active { transform: scale(.97); }
.pulse { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 1.4vh rgba(219,222,82,.18); } }

.nav { margin-top: auto; display: flex; justify-content: space-between; align-items: center; padding-top: 2vh; }

.search { font: inherit; font-size: 2.2vh; padding: 1.4vh 2vh; border-radius: 10px; border: 2px solid var(--line);
  background: rgba(0,0,0,.18); color: var(--ink); margin-bottom: 1.6vh; }
.song-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.song-list li { padding: 1.5vh 1.6vh; border-bottom: 1px solid var(--line); font-size: 2.2vh; cursor: pointer; border-radius: 8px; }
.song-list li small { opacity: .7; margin-left: .6em; }
.song-list li.sel { background: var(--cream); color: var(--btn-ink); }
.song-list .empty { opacity: .8; cursor: default; text-align: center; line-height: 1.5; }

.cards { display: flex; gap: 2vh; justify-content: center; flex-wrap: wrap; }
.card { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line);
  border-radius: 20px; padding: 2.4vh 2vh; min-width: 15vh; text-align: center; cursor: pointer; flex: 1; }
.card.sel { background: var(--cream); color: var(--btn-ink); border-color: var(--cream); }
.card-big { font-family: Fahkwang, Georgia, serif; font-size: 6.4vh; font-weight: 500; line-height: 1.1; }
.card-title { font-size: 2.3vh; font-weight: 600; }
.card-sub { font-size: 1.7vh; opacity: .8; margin: .6vh 0; }
.card-price { font-size: 2.3vh; font-weight: 700; margin-top: .8vh; }
.summary { margin-top: 3vh; font-size: 2.1vh; line-height: 1.7; background: var(--card); border-radius: 20px; padding: 2vh; }
.summary .total { font-family: Fahkwang, Georgia, serif; font-size: 3vh; font-weight: 500; color: var(--accent); border-top: 1px solid var(--line); margin-top: 1vh; padding-top: 1vh; }

.pay-box { display: flex; flex-direction: column; align-items: center; gap: 1.6vh; }
#pay-qr { width: 32vh; height: 32vh; background: #fff; border-radius: 20px; padding: 1vh; }
.pay-amount { font-family: Fahkwang, Georgia, serif; font-size: 4.4vh; font-weight: 500; color: var(--accent); }
.pay-status { font-size: 2vh; opacity: .85; }

.insert-art { font-size: 18vh; text-align: center; line-height: 1.2; opacity: .9; }

.ready-grid { display: grid; gap: 2vh; }
video { width: 100%; border-radius: 12px; background: #000; transform: scaleX(-1); }
#preview { max-height: 34vh; object-fit: cover; }
.meter { height: 2.4vh; border-radius: 8px; background: rgba(0,0,0,.3); overflow: hidden; }
#meter-fill { height: 100%; width: 0; background: linear-gradient(90deg, #7fbf5a, #d8d24a 75%, var(--red)); transition: width .06s; }

.rec-head { font-size: 2.4vh; font-weight: 700; display: flex; align-items: center; gap: 1vh; justify-content: center; font-variant-numeric: tabular-nums; }
.rec-dot { width: 1.6vh; height: 1.6vh; border-radius: 50%; background: var(--red); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }
.lyrics { flex: 1; display: flex; flex-direction: column; justify-content: center; text-align: center; gap: 2vh; min-height: 22vh; }
.lyric { font-family: Fahkwang, Georgia, serif; font-size: 3.6vh; font-weight: 500; line-height: 1.25; min-height: 4.6vh; }
.lyric.dim { font-size: 2.4vh; font-weight: 500; opacity: .5; }
#rec-cam { max-height: 24vh; object-fit: cover; }
.rec-bar { background: rgba(0,0,30,.35); }
.meter { background: rgba(0,0,30,.35); }
.countdown { position: absolute; left: 50%; bottom: 30vh; transform: translateX(-50%); padding: 1vh 4vh;
  font-size: 8vh; font-weight: 800; background: rgba(0,0,0,.45); border-radius: 18px; z-index: 5; white-space: nowrap; }
.flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 50; transition: opacity .35s; }
.flash.on { opacity: 1; transition: none; }

.tpl-row, .filter-row { display: flex; gap: 1vh; overflow-x: auto; padding-bottom: 1vh; }
.tpl { flex: 0 0 auto; border: 2px solid var(--line); border-radius: 10px; padding: .6vh; background: rgba(0,0,0,.15);
  font: inherit; color: var(--ink); font-size: 1.6vh; cursor: pointer; text-align: center; }
.tpl canvas { display: block; width: 14vh; border-radius: 4px; margin-bottom: .4vh; }
.tpl.sel { border-color: var(--accent); background: rgba(219,222,82,.18); }
.photo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1vh; overflow-y: auto; flex: 1; align-content: start; margin: 1vh 0; }
.photo { position: relative; border-radius: 8px; overflow: hidden; border: 3px solid transparent; cursor: pointer; }
.photo img { width: 100%; display: block; aspect-ratio: 4/3; object-fit: cover; }
.photo.sel { border-color: var(--accent); }
.photo .num { position: absolute; top: .5vh; left: .5vh; background: var(--accent); color: var(--btn-ink); font-weight: 800;
  border-radius: 50%; width: 3vh; height: 3vh; display: flex; align-items: center; justify-content: center; font-size: 1.7vh; }
.chip { font: inherit; font-size: 1.8vh; padding: .9vh 2vh; border-radius: 99px; border: 2px solid var(--line);
  background: transparent; color: var(--ink); cursor: pointer; flex: 0 0 auto; }
.chip.sel { background: var(--cream); color: var(--btn-ink); border-color: var(--cream); }

.card-preview { max-height: 62vh; max-width: 100%; margin: 0 auto; display: block; border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.4); background: #fff; }

#admin-hotspot { position: fixed; top: 0; left: 0; width: 70px; height: 70px; z-index: 40; }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 60; display: flex; align-items: center; justify-content: center; }
.admin-box { background: #222; color: #eee; border-radius: 14px; padding: 2.4vh; width: min(92vw, 720px); max-height: 92vh; overflow: auto; }
.admin-box h3 { margin-top: 0; }
#pin-input { font-size: 4vh; width: 100%; text-align: center; letter-spacing: .5em; padding: 1vh; border-radius: 8px; border: 0; }
#admin-status { background: #111; padding: 1.2vh; border-radius: 8px; font-size: 1.5vh; white-space: pre-wrap; }
.admin-btns { display: flex; flex-wrap: wrap; gap: 1vh; margin: 1.4vh 0; }
#admin-config { width: 100%; height: 36vh; font: 1.5vh/1.4 ui-monospace, Consolas, monospace; background: #111; color: #cfe; border-radius: 8px; padding: 1vh; border: 0; user-select: text; -webkit-user-select: text; }
.admin-box label { display: block; margin: 1vh 0 .6vh; opacity: .8; }

#print-area { display: none; }
@media print {
  @page { size: 4in 6in; margin: 0; }
  html, body { background: #fff !important; height: auto; overflow: visible; display: block; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; }
  #print-area img { width: 4in; height: 6in; display: block; page-break-after: always; break-after: page; }
}

/* voice-only recording */
.rec-bar { height: 1vh; background: rgba(0,0,0,.3); border-radius: 6px; margin: 1.4vh 0; overflow: hidden; }
#rec-progress { height: 100%; width: 0; background: var(--red); }
.prompts { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.6vh; text-align: center; min-height: 20vh; }
.prompt-label { font-size: 1.7vh; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--peri); }
#rec-meter { height: 100%; width: 0; background: linear-gradient(90deg, #7fbf5a, #d8d24a 75%, var(--red)); transition: width .06s; }
#v-record .meter { margin-bottom: 1.4vh; }

/* name your tape */
.field-row { display: flex; gap: 1.4vh; margin-bottom: 2vh; }
.field { flex: 1; font: inherit; text-align: left; color: var(--ink); background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 1.2vh 1.6vh; cursor: pointer; min-height: 9vh; }
.field.sel { border-color: var(--accent); }
.field-label { display: block; font-size: 1.5vh; opacity: .7; margin-bottom: .4vh; }
.field-val { font-size: 2.6vh; font-weight: 600; word-break: break-word; }
.field.sel .field-val::after { content: "▏"; animation: blink 1s steps(2) infinite; }
.keyboard { display: flex; flex-direction: column; gap: .9vh; }
.krow { display: flex; gap: .7vh; justify-content: center; }
.key { font: inherit; flex: 1; max-width: 6.4vh; height: 6.4vh; border-radius: 12px; border: 0; background: var(--card); color: #fff; border: 1px solid var(--line);
  font-size: 2.4vh; font-weight: 600; cursor: pointer; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.key.wide { max-width: 14vh; flex: 2; font-size: 1.9vh; }
.key.space { max-width: 34vh; flex: 6; }
.key:active { transform: translateY(2px); }

.welcome-logo { max-width: 46vh; max-height: 18vh; object-fit: contain; }
.tagline { font-size: 2.2vh; }

/* TCC wordmark + eyebrow */
.brand { display: flex; align-items: center; gap: 1.4vh; }
.brand svg { width: 6vh; height: 4vh; }
.brand span { font-family: Fahkwang, Georgia, serif; font-size: 2.4vh; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; }
.eyebrow { margin: 3vh 0 0; font-size: 1.7vh; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--peri); text-align: center; }
.welcome h1 { font-size: 6.4vh; }
.welcome .tagline { opacity: .82; font-size: 2.3vh; max-width: 44vh; }
.tape-icon { border-color: var(--accent); }
.tape-icon::after { border-color: var(--accent); }
.reel { border-color: var(--accent); }
.key.wide { color: var(--accent); }
.search { border-radius: 999px; }
.welcome .brand { margin-bottom: 6vh; }
.welcome { gap: 1.8vh; }

/* ---- iPad: the iPad is the screen, so no fake bezel ---- */
html, body { height: 100%; overscroll-behavior: none; touch-action: manipulation; -webkit-text-size-adjust: 100%; }
#device { width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; box-shadow: none; padding: 0; background: var(--screen); }
#screen { border-radius: 0; border: 0;
  padding: max(4vh, env(safe-area-inset-top)) max(4vh, calc((100vw - 78vh) / 2), env(safe-area-inset-right))
           max(3vh, env(safe-area-inset-bottom)) max(4vh, calc((100vw - 78vh) / 2), env(safe-area-inset-left)); }
.keys { display: none; }
#admin-hotspot { width: 90px; height: 90px; }
input, textarea { font-size: 16px; } /* stops iOS auto-zoom on focus */
