/* FREQUENZA – page, start page, original cabinet, touch pad */
:root {
  --ui-font: "Segoe UI", "Helvetica Neue", Roboto, Arial, sans-serif;
  --mag: #ff3cc8;
  --cyan: #3cf0ff;
  --gold: #ffe14a;
  --violet: #8f5bff;
  --ink: #07031a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; overflow: hidden; }
body {
  font-family: var(--ui-font);
  color: #fff;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  overscroll-behavior: none;
}
#app { position: fixed; inset: 0; overflow: hidden; background: #000; }
.layer { position: absolute; inset: 0; }
.hidden { display: none !important; }
button { font-family: inherit; }

/* ------------------------------------------------------------------ start page */
.select {
  position: absolute; inset: 0; overflow: hidden auto;
  display: flex; flex-direction: column; align-items: center;
  padding: max(14px, env(safe-area-inset-top)) 16px max(14px, env(safe-area-inset-bottom));
  background: radial-gradient(ellipse at 50% 35%, #1c0b46 0%, #07031a 60%, #000 100%);
  touch-action: pan-y;
}
.select .bg { position: fixed; inset: -3%; background-size: cover; background-position: center; opacity: 0; transition: opacity 1.4s; animation: bgdrift 40s ease-in-out infinite alternate; }
.select .bg.on { opacity: 0.55; }
@keyframes bgdrift { from { transform: scale(1.02) rotate(-0.4deg); } to { transform: scale(1.1) rotate(0.6deg); } }
.select .veil { position: fixed; inset: 0; background: linear-gradient(180deg, rgba(7, 3, 26, 0.35) 0%, rgba(7, 3, 26, 0.2) 30%, rgba(7, 3, 26, 0.86) 72%, #07031a 100%); }
.select .spark { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.select > *:not(.bg):not(.veil):not(.spark) { position: relative; }
.select .lang { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 14px; display: flex; gap: 6px; z-index: 3; }
.select .lang button {
  background: rgba(10, 4, 30, 0.6); color: #aab; border: 1px solid #4a3a8a; border-radius: 6px;
  padding: 5px 10px; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; cursor: pointer;
}
.select .lang button.on { color: #fff; border-color: var(--cyan); box-shadow: 0 0 10px rgba(60, 240, 255, 0.45); }
.select .logo { margin-top: clamp(8px, 3vh, 34px); width: min(820px, 94vw); text-align: center; }
.select .logo .logoimg { width: 100%; height: auto; display: block; mix-blend-mode: screen; filter: drop-shadow(0 0 18px rgba(255, 60, 200, 0.35)); animation: logopulse 3.2s ease-in-out infinite; }
@keyframes logopulse { 50% { filter: drop-shadow(0 0 30px rgba(60, 240, 255, 0.55)) brightness(1.12); } }
.select .wordmark { font-size: clamp(42px, 9vw, 110px); font-weight: 900; font-style: italic; letter-spacing: 0.04em; background: linear-gradient(90deg, var(--mag), var(--cyan), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 16px rgba(255, 60, 200, 0.6)); }
.select .tagline { margin-top: -0.4vh; font-size: clamp(14px, 2vw, 19px); color: #d9d4ff; text-shadow: 0 0 12px rgba(143, 91, 255, 0.8); text-align: center; letter-spacing: 0.02em; }
.select .ttl { margin: clamp(12px, 2.6vh, 26px) 0 10px; font-size: clamp(13px, 1.6vw, 16px); letter-spacing: 0.32em; color: var(--cyan); font-weight: 700; text-shadow: 0 0 10px rgba(60, 240, 255, 0.7); }
.select .cards { display: flex; gap: clamp(12px, 2.4vw, 30px); width: min(980px, 100%); justify-content: center; }
.select .card {
  flex: 1 1 0; max-width: 460px; min-width: 0; text-align: left; cursor: pointer;
  background: linear-gradient(180deg, rgba(20, 8, 50, 0.82), rgba(7, 3, 26, 0.92));
  border: 1.5px solid rgba(143, 91, 255, 0.45); border-radius: 16px; padding: 12px 12px 14px; color: #fff;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
  backdrop-filter: blur(4px);
}
.select .card.original.sel { border-color: var(--cyan); box-shadow: 0 0 26px rgba(60, 240, 255, 0.45), inset 0 0 18px rgba(60, 240, 255, 0.12); transform: translateY(-3px); }
.select .card.modern.sel { border-color: var(--mag); box-shadow: 0 0 26px rgba(255, 60, 200, 0.5), inset 0 0 18px rgba(255, 60, 200, 0.12); transform: translateY(-3px); }
.select .card .shot { height: clamp(150px, 30vh, 270px); border-radius: 10px; overflow: hidden; background: #000; display: flex; align-items: center; justify-content: center; position: relative; }
.select .card.original .shot { background: radial-gradient(ellipse at center, #070616 0%, #000 75%); box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.9); }
.select .card.original .shot canvas { height: 100%; width: auto; max-width: 100%; aspect-ratio: 3 / 4; display: block; }
.select .card .mshot { position: absolute; inset: 0; }
.select .card .mshot img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.03); transition: transform 3s; }
.select .card.sel .mshot img { transform: scale(1.12); }
.select .card h3 { margin: 12px 2px 4px; font-size: clamp(18px, 2.2vw, 24px); letter-spacing: 0.18em; font-weight: 900; }
.select .card.original h3 { color: var(--cyan); text-shadow: 0 0 12px rgba(60, 240, 255, 0.8); }
.select .card.modern h3 { color: var(--mag); text-shadow: 0 0 12px rgba(255, 60, 200, 0.8); }
.select .card p { margin: 0 2px; font-size: clamp(12.5px, 1.3vw, 14.5px); line-height: 1.45; color: #cfc9f2; min-height: 3em; }
.select .card .meta { display: flex; justify-content: space-between; margin: 10px 2px 0; font-size: 12.5px; letter-spacing: 0.12em; font-weight: 700; }
.select .card .hs { color: var(--gold); }
.select .card .go { color: #fff; opacity: 0.55; }
.select .card.sel .go { opacity: 1; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.35; } }
.select .hint { margin-top: 14px; font-size: 12px; letter-spacing: 0.2em; color: #8f86c8; }
.select .foot { margin: auto 0 0; padding-top: 16px; font-size: 11.5px; line-height: 1.5; color: #8780b8; text-align: center; max-width: 760px; }
.select .foot b { color: #c9c2ff; letter-spacing: 0.14em; font-size: 11px; }
@media (max-width: 720px), (max-aspect-ratio: 4/5) {
  .select .cards { flex-direction: column; align-items: stretch; }
  .select .card { max-width: none; display: grid; grid-template-columns: 38% 1fr; grid-template-rows: auto auto 1fr auto; column-gap: 12px; padding: 10px; }
  .select .card .shot { grid-row: 1 / 5; height: 150px; }
  .select .card h3 { margin-top: 2px; }
  .select .card p { font-size: 12.5px; min-height: 0; }
}

/* ------------------------------------------------------------------ the original cabinet */
#orig-wrap { display: flex; align-items: center; justify-content: center; background: #000; }
#orig-wrap.framed { background: radial-gradient(ellipse at center, #0c0820 0%, #000 80%); }
.cab-monitor {
  position: relative; flex: 0 0 auto; background: #000;
}
#orig-wrap.framed .cab-monitor { border-radius: 14px; box-shadow: 0 0 0 10px #0e0c18, 0 0 0 12px #2a2450, 0 0 50px rgba(70, 89, 255, 0.35); overflow: hidden; }
#orig-wrap.framed .cab-monitor::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 30% 18%, rgba(255, 255, 255, 0.07), transparent 42%), radial-gradient(ellipse at center, transparent 62%, rgba(0, 0, 0, 0.55) 100%);
}
#orig { width: 100%; height: 100%; display: block; }
.cab-side { flex: 0 0 auto; height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: 18px 22px; overflow: hidden; }
.cab-side .art { flex: 1 1 auto; max-height: 64%; border-radius: 10px; background: #050310 center / cover no-repeat; box-shadow: 0 0 0 2px #1f1a3c, 0 10px 30px rgba(0, 0, 0, 0.7); }
.cab-side .card { width: 100%; display: block; border-radius: 8px; box-shadow: 0 0 0 2px #1f1a3c, 0 0 22px rgba(70, 89, 255, 0.25); }

/* ------------------------------------------------------------------ touch pad: dial and buttons */
#pad { position: absolute; left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 5; }
#app.portrait #pad { height: min(230px, 30vh); display: flex; align-items: center; justify-content: space-between; padding: 8px 18px max(10px, env(safe-area-inset-bottom)); background: linear-gradient(180deg, #05030f, #000); border-top: 1px solid #1d1840; }
#app.landscape #pad { top: 0; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 max(18px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-bottom)); }
#pad .dial, #pad button { pointer-events: auto; touch-action: none; }
#pad .dial {
  width: min(170px, 26vh, 40vw); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #2b2160, #0c0820 70%);
  box-shadow: 0 0 0 3px #3a2f7a, 0 0 24px rgba(60, 240, 255, 0.25), inset 0 -8px 18px rgba(0, 0, 0, 0.6);
  position: relative;
}
#pad .dial .knob { position: absolute; inset: 10%; border-radius: 50%; background: repeating-conic-gradient(from 0deg, #3d3480 0 6deg, #251d55 6deg 12deg); box-shadow: inset 0 0 0 2px #574aa8; }
#pad .dial .knob i { position: absolute; left: 50%; top: 6%; width: 10%; height: 22%; margin-left: -5%; border-radius: 6px; background: var(--gold); box-shadow: 0 0 10px var(--gold); }
#pad .btns { display: flex; gap: 12px; align-items: flex-end; }
#pad button {
  width: min(96px, 15vh, 22vw); aspect-ratio: 1; border-radius: 50%; border: 0; color: #fff;
  font-weight: 900; font-size: 13px; letter-spacing: 0.06em;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.55), 0 0 18px rgba(255, 255, 255, 0.12);
}
#pad button.fire { width: min(120px, 18vh, 27vw); background: radial-gradient(circle at 45% 35%, #ffef8a, #e0a800 70%); color: #3a2400; }
#pad button.zap { background: radial-gradient(circle at 45% 35%, #ff7ee0, #c4119a 70%); }
#pad button.jump { background: radial-gradient(circle at 45% 35%, #8ff8ff, #0a9fb8 70%); color: #003040; }
#pad button.menu { position: absolute; width: 44px; height: 44px; aspect-ratio: auto; border-radius: 12px; font-size: 20px; background: rgba(40, 30, 90, 0.8); color: #dcd6ff; box-shadow: 0 0 0 1px #4a3a8a; }
#app.portrait #pad button.menu { left: 50%; top: 10px; margin-left: -22px; }
#app.landscape #pad button.menu { left: max(12px, env(safe-area-inset-left)); top: max(12px, env(safe-area-inset-top)); }
#pad button.on { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.55), 0 0 26px rgba(255, 255, 255, 0.4); }

/* ------------------------------------------------------------------ toast, fade, loading */
#toast {
  position: absolute; left: 50%; top: max(14px, env(safe-area-inset-top)); transform: translate(-50%, -20px); opacity: 0;
  background: rgba(10, 4, 30, 0.85); border: 1px solid var(--violet); color: #fff; border-radius: 999px;
  padding: 7px 18px; font-size: 13px; letter-spacing: 0.12em; font-weight: 700; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s; z-index: 20;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#fade { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; z-index: 30; }
#modern-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--cyan); letter-spacing: 0.3em; font-weight: 700; text-align: center; padding: 20px; background: #07031a; z-index: 10; }
