/* «Глубина» — shared theme layer loaded after site.css on every page.
   Remaps site.css tokens to the deep-ocean palette and restyles shared chrome
   (header, buttons, cards, heroes, tables, footer). Page-specific layout stays in site.css. */

html, html[data-theme="light"], html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #02070d; --bg-2: #05111b; --bg-3: #0a2234;
  --surface: rgba(10, 30, 45, 0.55); --surface-2: rgba(12, 36, 54, 0.92);
  --line: rgba(69, 227, 255, 0.16); --separator: rgba(255, 255, 255, 0.1); --fill: rgba(255, 255, 255, 0.05);
  --text: #eaf7ff; --muted: #8fb0c4; --label: #eaf7ff; --label-secondary: #8fb0c4;
  --aqua: #45e3ff; --aqua-2: #9feeff; --accent: #45e3ff; --gold: #ffcf5a; --gold-2: #ffe08a;
  --radius: 20px; --radius-sm: 12px;
  --shadow: 0 30px 80px rgba(0, 4, 10, 0.6);
  --font: "Onest", "Ubuntu", system-ui, sans-serif;
  --display: "Unbounded", "Onest", system-ui, sans-serif;
  --px: "Press Start 2P", monospace;
  --deep-teal: #45e3ff; --deep-teal-2: #1fb7e0;
  --common: #b9c6cf; --uncommon: #7fe38f; --rare: #4fc3ff; --epic: #c78cff; --legendary: #ffb547;
  --deep-ease: cubic-bezier(.2, .8, .2, 1);
}
html { background: #02070d; overflow-x: clip; }
body { background: transparent !important; color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; overflow-x: clip; }
::selection { background: var(--deep-teal); color: #02121c; }

/* ---------- ocean backdrop + marine snow (deep.js adds the nodes) ---------- */
.deep-ocean { position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(120% 70% at 70% -10%, #0e4466 0%, transparent 60%),
    linear-gradient(180deg, #072a42 0%, #04182a 40%, #02070d 100%); }
.deep-ocean::after { content: ""; position: absolute; inset: 0; opacity: .07; mix-blend-mode: overlay;
  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='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.deep-snow { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }

/* ---------- header: floating glass bar ---------- */
#site-header { position: sticky; top: 0; z-index: 60; height: 0; }
.site-header, [data-theme] .site-header {
  position: relative; top: 14px; width: min(1180px, calc(100% - 32px)); margin: 0 auto;
  border-radius: 16px; border: 1px solid rgba(159, 233, 255, .12) !important;
  background: linear-gradient(180deg, rgba(13, 42, 63, .72), rgba(6, 24, 39, .72)) !important;
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .07);
  padding-top: 0;
}
main { padding-top: 84px; }
.header-inner { min-height: 58px; }
.site-header .brand span { font-family: var(--display); font-weight: 800; letter-spacing: .01em; }
.nav-desktop a, .nav-more summary { border-radius: 10px; transition: background .3s, color .3s; }
.nav-desktop a:hover, .nav-more summary:hover { background: rgba(255, 255, 255, .06); }
.nav-desktop a.active, .nav-desktop a[aria-current="page"] { color: #fff; background: rgba(69, 227, 255, .12); box-shadow: inset 0 0 0 1px rgba(69, 227, 255, .3); }
.nav-more-panel, .header-account-panel { background: rgba(5, 18, 29, .96) !important; border: 1px solid rgba(69, 227, 255, .18) !important; border-radius: 14px !important; backdrop-filter: blur(16px); }
.theme-toggle { display: none !important; }
.header-live { font-family: var(--px); font-size: 9px !important; letter-spacing: .08em; text-transform: uppercase; }
.mobile-nav { background: rgba(2, 10, 18, .97) !important; }

/* ---------- buttons ---------- */
.header-cta, .btn-primary, .nav-cta, .start-download-btn {
  position: relative; overflow: hidden; isolation: isolate; border: 0 !important; border-radius: 0 !important;
  color: #1d1203 !important; font-weight: 600;
  background: linear-gradient(180deg, #ffe08a, #ffcf5a 45%, #f2a530) !important;
  clip-path: polygon(0 6px, 6px 6px, 6px 0, calc(100% - 6px) 0, calc(100% - 6px) 6px, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 6px calc(100% - 6px), 0 calc(100% - 6px));
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .19), inset 0 3px 0 rgba(255, 255, 255, .44) !important;
  transition: transform .4s var(--deep-ease), filter .4s;
}
.header-cta::after, .btn-primary::after, .nav-cta::after, .start-download-btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1; transform: translateX(-120%);
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .6) 50%, transparent 70%); transition: transform .8s var(--deep-ease); }
.header-cta:hover::after, .btn-primary:hover::after, .nav-cta:hover::after, .start-download-btn:hover::after { transform: translateX(120%); }
.header-cta:hover, .btn-primary:hover, .start-download-btn:hover { filter: brightness(1.06) drop-shadow(0 10px 30px rgba(255, 180, 71, .4)); }
.btn-secondary, .btn-ghost, .header-signin {
  border-radius: 12px !important; border: 1px solid rgba(191, 239, 255, .2) !important;
  background: rgba(10, 34, 53, .5) !important; color: #e6f6ff !important; backdrop-filter: blur(10px);
  transition: border-color .4s, background .4s, transform .4s var(--deep-ease) !important; }
.btn-secondary:hover, .btn-ghost:hover, .header-signin:hover { border-color: rgba(191, 239, 255, .55) !important; background: rgba(15, 46, 70, .6) !important; }

/* ---------- type ---------- */
h1, h2, h3, .lp-title, .lp-h2, .start-main-title { font-family: var(--display); letter-spacing: -.03em; }
h1, .start-main-title, .lp-title { font-weight: 800 !important; line-height: 1 !important; }
h1 em, h1 .gradient-aqua, h1 span[style*="aqua"] { font-style: normal;
  background: linear-gradient(100deg, #fff2c2, #ffcf5a 40%, #ff9d3c) !important; -webkit-background-clip: text !important; background-clip: text !important; color: transparent !important; }
.eyebrow, .micro-label, .hero-kicker, .lp-kicker {
  display: inline-flex; align-items: center; gap: 12px; font-family: var(--px) !important; font-size: 10px !important;
  letter-spacing: .14em !important; text-transform: uppercase; color: var(--deep-teal) !important; font-weight: 400 !important; }
.eyebrow::before, .micro-label::before { content: ""; width: 28px; height: 2px; background: currentColor; flex: none; }
.tag, .meta-tag, .rarity-badge, .notice-pill {
  font-family: var(--px) !important; font-size: 8.5px !important; letter-spacing: .08em; text-transform: uppercase;
  border-radius: 0 !important; padding: 6px 8px !important; }
.muted-line, .muted { color: var(--muted); }

/* ---------- heroes: underwater shot behind every page title ---------- */
.page-hero, .subpage-hero, .start-hero, .lp-hero { position: relative; isolation: isolate; }
.page-hero::before, .subpage-hero::before, .start-hero::before, .lp-hero::before {
  content: ""; position: absolute; inset: -84px 0 0 0; z-index: -1; pointer-events: none;
  background: radial-gradient(70% 90% at 50% 40%, rgba(2, 10, 20, .62), rgba(2, 10, 20, .25)), url("../images/bg_main.webp") 70% 30% / cover no-repeat;
  -webkit-mask-image: linear-gradient(#000 40%, transparent); mask-image: linear-gradient(#000 40%, transparent);
  opacity: .9; animation: deepHeroIn 2.4s var(--deep-ease) both; }
@keyframes deepHeroIn { from { transform: scale(1.12); opacity: 0; } }

/* ---------- surfaces ---------- */
.card, .panel, .feature-card, .machine-card, .hero-card, .stat-card, .loot-block, .guide-block, .start-step-card,
.podium-card, .apple-coin-card, .apple-matrix-card, .lk-balance-card, .admin-card, .status-stat, .in-game-notice-card,
.quick-connect-card, .bento-card, .news-card, .event-card, .market-card, .case-card, .tier-card, .rank-card {
  position: relative; border-radius: var(--radius) !important;
  background: linear-gradient(170deg, rgba(13, 38, 56, .78), rgba(5, 15, 24, .86)) !important;
  border: 1px solid rgba(159, 233, 255, .1) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25) !important;
  transition: transform .5s var(--deep-ease), border-color .4s, box-shadow .5s !important;
}
[data-deep-spot] { overflow: hidden; }
[data-deep-spot]::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; opacity: 0; transition: opacity .4s;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 0%), rgba(69, 227, 255, .14), transparent 70%); }
[data-deep-spot]:hover::after { opacity: 1; }
[data-deep-spot]:hover { border-color: rgba(69, 227, 255, .35) !important; box-shadow: 0 30px 70px rgba(0, 0, 0, .35), 0 0 40px rgba(69, 227, 255, .08) !important; }

/* tables */
.loot-table th, table th { font-family: var(--px); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--deep-teal); }
.loot-table tr, table tr { transition: background .3s; }
.loot-table tbody tr:hover, table tbody tr:hover { background: rgba(69, 227, 255, .05); }

/* forms */
.field input, .field select, .field textarea, input[type="text"], input[type="email"], input[type="password"], input[type="search"] {
  border-radius: 12px !important; border: 1px solid rgba(159, 233, 255, .16) !important; background: rgba(3, 14, 23, .7) !important; color: var(--text) !important; }
.field input:focus, input:focus, select:focus, textarea:focus { outline: none; border-color: var(--deep-teal) !important; box-shadow: 0 0 0 3px rgba(69, 227, 255, .2) !important; }

/* footer */
.site-footer { background: transparent !important; border-top: 1px solid rgba(255, 255, 255, .08) !important; position: relative; }
.site-footer h4 { font-family: var(--px); font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--deep-teal); }
.site-footer a { transition: color .3s; }
.site-footer a:hover { color: #fff; }

/* ---------- motion: reveal, cursor, ripple, page transition ---------- */
[data-deep-reveal] { opacity: 0; transform: translateY(34px); transition: opacity 1s var(--deep-ease), transform 1.1s var(--deep-ease); }
[data-deep-reveal].is-in { opacity: 1; transform: none; }
.deep-cur { position: fixed; left: 0; top: 0; z-index: 100002; pointer-events: none; mix-blend-mode: difference; }
.deep-cur-dot { width: 6px; height: 6px; margin: -3px; background: #fff; border-radius: 50%; }
.deep-cur-ring { width: 38px; height: 38px; margin: -19px; border: 1px solid #fff; border-radius: 50%; transition: width .35s var(--deep-ease), height .35s var(--deep-ease), margin .35s var(--deep-ease), background .35s; }
.deep-cur-ring.hot { width: 70px; height: 70px; margin: -35px; background: rgba(255, 255, 255, .08); }
.deep-ripple { position: fixed; z-index: 9997; pointer-events: none; width: 0; height: 0; }
.deep-ripple i { position: absolute; width: 120px; height: 44px; margin: -22px -60px; border: 1.5px solid #bff4ff; border-radius: 50%; animation: deepRip 1.1s var(--deep-ease) forwards; }
.deep-ripple i:nth-child(2) { animation-delay: .12s; } .deep-ripple i:nth-child(3) { animation-delay: .24s; }
@keyframes deepRip { from { transform: scale(.1); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }
@media (pointer: fine) { html.deep-cursor, html.deep-cursor a, html.deep-cursor button, html.deep-cursor summary { cursor: none; } }
.deep-curtain { position: fixed; inset: 0; z-index: 9999; pointer-events: none; }
.deep-curtain svg { width: 100%; height: 100%; display: block; }

@media (prefers-reduced-motion: reduce) {
  [data-deep-reveal] { opacity: 1; transform: none; }
  .deep-cur, .deep-snow, .deep-curtain { display: none; }
  .page-hero::before, .subpage-hero::before, .start-hero::before, .lp-hero::before { animation: none; }
}
@media (max-width: 760px) { main { padding-top: 76px; } }
