/* Shared shell for the GorbaTech game demos: theme tokens from assets/css/style.css, top bar, stage, overlays. */
@font-face {
  font-family: "Ubuntu Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../../assets/fonts/ubuntu-sans-greek-wght-normal.woff2") format("woff2");
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: "Ubuntu Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../../assets/fonts/ubuntu-sans-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg-dark: #06090e;
  --bg-card: rgba(15, 23, 42, 0.75);
  --border-color: rgba(255, 255, 255, 0.08);
  --primary: #38bdf8;
  --primary-glow: rgba(56, 189, 248, 0.4);
  --secondary: #818cf8;
  --accent: #22d3ee;
  --emerald: #34d399;
  --danger: #f87171;
  --gold: #fbbf24;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --bar-h: 56px;
  --font-main: "Ubuntu Sans", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-main);
  line-height: 1.5;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 15% 10%, rgba(56, 189, 248, 0.18), transparent 45%),
    radial-gradient(circle at 85% 90%, rgba(129, 140, 248, 0.18), transparent 50%),
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px) 0 0 / 60px 60px,
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px) 0 0 / 60px 60px;
  pointer-events: none;
}

.icon { display: inline-block; height: 1em; width: auto; fill: currentColor; vertical-align: -0.125em; }

/* Top bar */
.demo-bar {
  position: relative;
  z-index: 10;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: rgba(6, 9, 14, 0.88);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
}
.demo-back {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
  text-decoration: none;
  min-width: 0;
}
.demo-back img { width: 32px; height: 32px; }
.demo-back .logo-text { font-weight: 800; font-size: 17px; letter-spacing: -0.02em; }
.demo-back .logo-text span { color: var(--primary); }
.demo-back .back-arrow { color: var(--text-muted); font-size: 14px; }
.demo-title {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.demo-title b { color: var(--accent); font-weight: 700; }
.demo-tools { display: flex; gap: 6px; }
.demo-tool {
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.8);
  color: var(--text-main);
  font: 600 13px var(--font-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.demo-tool:hover { border-color: var(--primary); color: var(--primary); }
.demo-tool[aria-pressed="false"] { color: var(--text-muted); }

/* Stage: fixed aspect ratio, scaled to the space below the bar. Children size in cqw / cqh. */
.demo-main {
  position: relative;
  height: calc(100% - var(--bar-h));
  display: grid;
  place-items: center;
  padding: 12px;
}
.stage {
  --ar: 9 / 16;
  position: relative;
  aspect-ratio: var(--ar);
  width: min(100%, calc((100dvh - var(--bar-h) - 24px) * var(--arw)));
  max-height: 100%;
  container-type: size;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(56, 189, 248, 0.25);
  background: #0b1220;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 60px rgba(56, 189, 248, 0.12);
}
.stage.portrait { --ar: 9 / 16; --arw: 0.5625; }
.stage.landscape { --ar: 16 / 9; --arw: 1.7778; }
.stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }

:fullscreen .demo-main, .is-fullscreen .demo-main { padding: 0; }

/* Screens inside a stage */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s;
}
.screen.active { opacity: 1; visibility: visible; }

.gt-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.5em 1.1em;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.08);
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.pulse-dot {
  width: 0.6em;
  height: 0.6em;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 0.6em rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  border: 0;
  border-radius: 999px;
  padding: 0.8em 2em;
  font: 800 1em var(--font-main);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #04121d;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 0.5em 1.6em var(--primary-glow), inset 0 -0.2em 0 rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.gt-btn:hover { transform: translateY(-2px); }
.gt-btn:active { transform: translateY(1px) scale(0.98); }
.gt-btn.ghost { background: rgba(15, 23, 42, 0.8); color: var(--text-main); border: 1px solid rgba(56, 189, 248, 0.45); box-shadow: none; }
.gt-btn[hidden] { display: none; }
.btn-pulse { animation: btnPulse 1.8s ease-in-out infinite; }
@keyframes btnPulse { 50% { transform: scale(1.06); } }

.glass {
  background: rgba(10, 15, 29, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
}

.demo-note {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1.6cqh;
  font-size: max(9px, 1.6cqmin);
  color: var(--text-muted);
  opacity: 0.8;
}

/* Flash message that pops in the middle of a stage */
.popup {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%) scale(0.6);
  opacity: 0;
  pointer-events: none;
  font-weight: 800;
  width: max-content;
  max-width: 84%;
  font-size: 9cqmin;
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-align: center;
  text-wrap: balance;
  overflow-wrap: break-word;
  text-shadow: 0 0.08em 0.4em rgba(0, 0, 0, 0.7);
  transition: transform 0.25s cubic-bezier(.2, 1.6, .4, 1), opacity 0.2s;
}
.popup.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

@media (max-width: 560px) {
  .demo-back .logo-text, .demo-back .back-arrow { display: none; }
  .demo-title { font-size: 11px; letter-spacing: 0.06em; }
  .demo-main { padding: 6px; }
  .stage { border-radius: var(--radius-md); }
}
@media (prefers-reduced-motion: reduce) {
  .btn-pulse, .pulse-dot { animation: none; }
}

/* Contact modal (shared/contact.js) */
.gt-contact { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; }
.gt-contact[hidden] { display: none; }
.gt-contact-backdrop { position: absolute; inset: 0; background: rgba(2, 6, 12, 0.78); backdrop-filter: blur(6px); }
.gt-contact-card {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.97), rgba(10, 15, 29, 0.97));
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 50px rgba(56, 189, 248, 0.12);
  user-select: text;
}
.gt-contact-card h2 { font-size: 26px; line-height: 1.2; }
.gt-contact-intro { color: var(--text-muted); font-size: 14.5px; }
.gt-contact-tag {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; border-radius: 999px;
  font: 600 11px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--primary); background: rgba(56, 189, 248, 0.08); border: 1px solid rgba(56, 189, 248, 0.3);
}
.gt-contact-tag b { color: var(--text-main); }
.gt-contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gt-contact-card label { display: flex; flex-direction: column; gap: 6px; font: 600 11.5px var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--primary); }
.gt-contact-card input:not([type="checkbox"]), .gt-contact-card textarea {
  font: 400 15px var(--font-main);
  color: var(--text-main);
  background: rgba(6, 9, 14, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 12px;
  resize: vertical;
}
.gt-contact-card input:focus, .gt-contact-card textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2); }
.gt-contact-card .gt-contact-consent { flex-direction: row; align-items: flex-start; gap: 10px; font: 400 13px var(--font-main); text-transform: none; letter-spacing: 0; color: var(--text-muted); }
.gt-contact-consent input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--primary); flex-shrink: 0; }
.gt-contact-consent a { color: var(--primary); }
.gt-contact-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.gt-contact-status { font-size: 14px; min-height: 1.2em; color: var(--text-muted); }
.gt-contact-status[data-state="error"] { color: var(--danger); }
.gt-contact-status[data-state="ok"] { color: var(--emerald); }
.gt-contact-card .gt-btn { align-self: flex-start; font-size: 14px; }
.gt-contact-x { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border-color); background: rgba(15, 23, 42, 0.9); color: var(--text-muted); cursor: pointer; font-size: 16px; }
.gt-contact-x:hover { color: var(--primary); border-color: var(--primary); }
@media (max-width: 520px) {
  .gt-contact-card { padding: 22px 18px; }
  .gt-contact-grid { grid-template-columns: 1fr; }
  .gt-contact-card h2 { font-size: 22px; }
}

/* "Contact us" buttons stay on one line */
.gt-btn[data-contact] { white-space: nowrap; padding-left: 1.6em; padding-right: 1.6em; }
