/* World Communications — event game theme (shared look, copied into each game folder) */
@font-face {
  font-family: 'DM Sans';
  src: url('../assets/DMSans-VF.ttf') format('truetype');
  font-weight: 100 1000;
  font-display: swap;
}

:root {
  /* Brand: deep navy letterhead, silver script, white */
  --navy-950: #050b12;
  --navy-900: #0a1520;
  --navy-800: #0f1f2e;
  --navy-700: #16293b;
  --steel-600: #2a3f54;
  --steel-500: #3d5670;
  --steel-400: #6b8199;
  --silver-300: #a9b6c4;
  --silver-200: #c9d2dc;
  --silver-100: #e6ebf1;
  --white: #ffffff;
  /* Accents for game moments */
  --ice: #7cc4ff;
  --ice-deep: #2f86d8;
  --champagne: #e9cf96;
  --champagne-deep: #b8914a;
  --good: #5fd3a4;
  --bad: #ff7a8a;

  --silver-grad: linear-gradient(180deg, #ffffff 0%, #dfe6ee 38%, #9fb0c2 62%, #e9eef4 100%);
  --gold-grad: linear-gradient(180deg, #fff6dc 0%, #e9cf96 45%, #b8914a 70%, #f3e2b8 100%);
  --glass: linear-gradient(160deg, rgba(255,255,255,.14), rgba(255,255,255,.04) 45%, rgba(255,255,255,.02));
  --glass-edge: rgba(255,255,255,.18);
  --shadow-deep: 0 40px 80px -20px rgba(0,0,0,.65), 0 18px 36px -18px rgba(0,0,0,.55);
  --radius: 22px;
  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--silver-100);
  background: var(--navy-900);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }

/* ---------- Ambient 3D backdrop ---------- */
.stage-bg {
  position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% -10%, #1d3550 0%, transparent 60%),
    radial-gradient(90% 70% at 50% 120%, #0d2236 0%, transparent 60%),
    linear-gradient(180deg, var(--navy-800), var(--navy-950));
}
.orb {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55;
  animation: drift 26s ease-in-out infinite alternate;
}
.orb.a { width: 46vmax; height: 46vmax; left: -12vmax; top: -14vmax; background: radial-gradient(circle at 35% 35%, #4d79a6, transparent 65%); }
.orb.b { width: 40vmax; height: 40vmax; right: -14vmax; top: 8vmax; background: radial-gradient(circle at 50% 50%, #8fa7bf, transparent 62%); opacity: .32; animation-duration: 32s; animation-delay: -8s; }
.orb.c { width: 36vmax; height: 36vmax; left: 30vw; bottom: -20vmax; background: radial-gradient(circle at 50% 50%, #2f86d8, transparent 60%); opacity: .35; animation-duration: 38s; animation-delay: -14s; }
@keyframes drift {
  0% { transform: translate3d(0,0,0) scale(1); }
  50% { transform: translate3d(6vw, 4vh, 0) scale(1.12); }
  100% { transform: translate3d(-4vw, 7vh, 0) scale(.94); }
}
/* perspective floor grid */
.floor {
  position: absolute; left: -50%; right: -50%; bottom: -10%; height: 70%;
  transform-origin: 50% 0%;
  transform: perspective(700px) rotateX(72deg);
  background-image:
    linear-gradient(rgba(169,182,196,.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(169,182,196,.16) 1px, transparent 1px);
  background-size: 80px 80px;
  animation: floor-move 6s linear infinite;
  mask-image: linear-gradient(180deg, transparent 0%, #000 40%, #000 70%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 40%, #000 70%, transparent 100%);
}
@keyframes floor-move { to { background-position: 0 80px, 0 0; } }
.vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,.6) 100%); }
.grain {
  position: absolute; inset: -50%; opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Brand bits ---------- */
.logo-white { filter: brightness(0) invert(1); opacity: .92; }
.logo-white.custom-logo { max-width: 24vw; object-fit: contain; object-position: left center; }
.brand-wait img.logo-white { visibility: hidden; }

/* Extruded 3D silver headline */
.title-3d {
  font-weight: 900; letter-spacing: -.02em; line-height: .9; margin: 0;
  background: var(--silver-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter:
    drop-shadow(0 1px 0 #8293a6) drop-shadow(0 2px 0 #6d7f93) drop-shadow(0 3px 0 #5a6c80)
    drop-shadow(0 4px 0 #475a6e) drop-shadow(0 5px 0 #34475b) drop-shadow(0 6px 0 #223548)
    drop-shadow(0 18px 24px rgba(0,0,0,.55));
}
.title-3d.gold {
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text;
  filter:
    drop-shadow(0 1px 0 #a88340) drop-shadow(0 2px 0 #957237) drop-shadow(0 3px 0 #82612e)
    drop-shadow(0 4px 0 #6e5126) drop-shadow(0 5px 0 #5a411e) drop-shadow(0 6px 0 #463216)
    drop-shadow(0 18px 30px rgba(0,0,0,.6));
}

/* Glass panel with depth */
.glass {
  position: relative;
  background: var(--glass), rgba(15,31,46,.55);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow-deep), inset 0 1px 0 rgba(255,255,255,.25), inset 0 -1px 0 rgba(0,0,0,.4);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}
.glass::before { /* specular sheen */
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,.18) 0%, rgba(255,255,255,0) 30%);
}

/* Chunky 3D button */
.btn {
  --face: linear-gradient(180deg, #ffffff, #d5dde6);
  --side: #7f90a3;
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  border: 0; border-radius: 16px; padding: .9em 1.4em; cursor: pointer;
  font-weight: 800; letter-spacing: .01em; color: var(--navy-900);
  background: var(--face);
  box-shadow: 0 6px 0 var(--side), 0 14px 24px -6px rgba(0,0,0,.55), inset 0 1px 0 #fff;
  transform: translateY(0); transition: transform .08s, box-shadow .08s, filter .15s;
  user-select: none; -webkit-user-select: none;
}
.btn:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--side), 0 6px 12px -6px rgba(0,0,0,.5), inset 0 1px 0 #fff; }
.btn:disabled { filter: grayscale(.6) brightness(.7); cursor: not-allowed; }
.btn.ice { --face: linear-gradient(180deg, #a8dbff, #4ea7f0); --side: #1e5f9e; color: #04213b; }
.btn.gold { --face: var(--gold-grad); --side: #7a5c26; color: #3a2a0c; }
.btn.dark { --face: linear-gradient(180deg, #2c4258, #1a2d40); --side: #0a1520; color: var(--silver-100); box-shadow: 0 6px 0 var(--side), 0 14px 24px -6px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.15); }
.btn.danger { --face: linear-gradient(180deg, #ffb3bd, #ff7a8a); --side: #9e3443; color: #3b0710; }
.btn.small { padding: .55em .9em; border-radius: 12px; font-size: .9em; }
.btn.block { width: 100%; }

.input {
  width: 100%; padding: .95em 1.1em; border-radius: 14px; border: 1px solid rgba(255,255,255,.2);
  background: rgba(5,11,18,.55); color: var(--white); outline: none;
  box-shadow: inset 0 3px 8px rgba(0,0,0,.45);
}
.input:focus { border-color: var(--ice); box-shadow: inset 0 3px 8px rgba(0,0,0,.45), 0 0 0 3px rgba(124,196,255,.25); }

.muted { color: var(--silver-300); }
.hidden { display: none !important; }

/* Toast */
.toast-wrap { position: fixed; left: 0; right: 0; top: 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 1000; pointer-events: none; padding: 0 16px; }
.toast { padding: .75em 1.1em; border-radius: 14px; font-weight: 700; max-width: 520px; text-align: center;
  background: rgba(10,21,32,.92); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-deep);
  animation: toast-in .35s cubic-bezier(.2,1.4,.4,1) both; }
.toast.out { animation: toast-out .3s ease-in both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-20px) scale(.9); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-14px); } }

/* Confetti canvas */
.fx-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 900; }

/* Host control dock (auto-hides) */
.dock {
  position: fixed; right: 18px; bottom: 18px; z-index: 950; display: flex; gap: 10px; align-items: center;
  padding: 10px; opacity: .08; transition: opacity .25s, transform .25s; transform: translateY(6px);
}
.dock:hover, .dock:focus-within, .dock.show, .dock.pinned { opacity: 1; transform: none; }
.dock-label { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--silver-300); padding: 0 6px 0 4px; }
.modal-back { position: fixed; inset: 0; background: rgba(2,6,10,.7); z-index: 980; display: grid; place-items: center; padding: 24px; }
.modal { width: min(720px, 100%); max-height: 90vh; overflow: auto; padding: 28px; }
.modal h2 { margin: 0 0 16px; font-size: 26px; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 14px; font-weight: 700; color: var(--silver-200); letter-spacing: .04em; text-transform: uppercase; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

@media (prefers-reduced-motion: reduce) {
  .orb, .floor { animation: none; }
}
