/* Dice Room — витрина игр. Тёмный «игровой стол» и у каждой игры своя палитра. */

:root {
  --bg: #100e1f;
  --bg-2: #18152b;
  --indigo-ink: #1b1838;
  --ink: #f4eee4;
  --muted: #a9a3b5;
  --line: rgba(255, 255, 255, 0.09);
  --amber: #f0b54d;
  --amber-ink: #1d1404;

  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Unbounded", "Manrope", system-ui, sans-serif;

  /* Детекторий */
  --det-bg: #141a26;
  --det-bg-2: #1c2436;
  --det-manila: #f1e3bd;
  --det-red: #c4362a;
  --det-ink: #1f2a44;
  /* Море Сна */
  --dr-bg: #161130;
  --dr-bg-2: #2b1e52;
  --dr-gold: #f5cf7a;
  --dr-lilac: #cdb9ff;
  /* Агора */
  --ag-bg: #0c1524;
  --ag-bg-2: #13253d;
  --ag-gold: #e4b45c;
  --ag-parch: #f3e6c8;

  --radius: 28px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(1200px 700px at 78% -10%, rgba(240, 181, 77, 0.16), transparent 60%),
    radial-gradient(900px 600px at -10% 30%, rgba(120, 90, 200, 0.12), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ───── шапка ───── */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px var(--gutter);
  padding-top: max(14px, env(safe-area-inset-top));
  background: rgba(16, 14, 31, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.02em;
}

.die {
  width: 32px;
  height: 32px;
  transform: rotate(-12deg);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1.3);
}
.die-body {
  fill: var(--ink);
}
.die-pip {
  fill: var(--indigo-ink);
}
.die-door {
  fill: var(--amber);
}
.die-light {
  fill: #ffe2a3;
}
.die {
  filter: drop-shadow(0 0 8px rgba(240, 181, 77, 0.35));
}
.brand:hover .die {
  transform: rotate(0deg) translateY(-2px);
}

.nav {
  display: flex;
  gap: 6px;
}
.nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  font-size: 15px;
  padding: 6px 12px;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}
.nav a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
}

/* ───── кнопки ───── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}
.btn::after {
  content: "→";
  transition: transform 0.2s;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn:hover::after {
  transform: translateX(4px);
}
.btn:active {
  transform: translateY(0);
}
.btn-amber {
  background: var(--amber);
  color: var(--amber-ink);
  box-shadow: 0 10px 30px -10px rgba(240, 181, 77, 0.7);
}
.btn-amber::after {
  content: "↓";
}
.btn-amber:hover::after {
  transform: translateY(3px);
}

/* ───── герой ───── */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: center;
  gap: 48px;
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(40px, 8vw, 96px) var(--gutter) clamp(48px, 8vw, 110px);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--amber);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(28px, 3.7vw, 46px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.lead {
  margin: 22px 0 32px;
  max-width: 34em;
  color: var(--muted);
  font-size: clamp(17px, 1.6vw, 19px);
}

.hero-fan {
  position: relative;
  height: clamp(300px, 34vw, 420px);
}

.fan-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(150px, 17vw, 210px);
  aspect-ratio: 4 / 5;
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 30px 60px -20px rgba(0, 0, 0, 0.8);
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.fan-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fan-1 {
  transform: translate(-112%, -46%) rotate(-11deg);
}
.fan-2 {
  z-index: 2;
  transform: translate(-50%, -56%);
}
.fan-3 {
  transform: translate(12%, -46%) rotate(11deg);
}
.fan-3 img {
  object-position: top;
}
.hero-fan:hover .fan-1 {
  transform: translate(-128%, -48%) rotate(-15deg);
}
.hero-fan:hover .fan-3 {
  transform: translate(28%, -48%) rotate(15deg);
}
.hero-fan .fan-card:hover {
  z-index: 3;
}

/* ───── блоки игр ───── */

.games {
  display: grid;
  gap: clamp(24px, 4vw, 40px);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  scroll-margin-top: 80px;
}

.game {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 5vw, 64px);
  padding: clamp(24px, 5vw, 56px);
  border-radius: var(--radius);
  overflow: hidden;
  scroll-margin-top: 80px;
  isolation: isolate;
}
.game:nth-child(even) .game-visual {
  order: 2;
}

.kicker {
  margin: 0 0 6px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.game-title {
  margin: 0 0 16px;
  line-height: 1;
}
.game-lead {
  margin: 0 0 20px;
  font-size: 17px;
}
.game-lead em {
  font-style: normal;
  font-weight: 700;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}
.chips li {
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid currentColor;
}

.modes {
  display: grid;
  gap: 12px;
  margin: 0 0 28px;
}
.modes div {
  padding-left: 14px;
  border-left: 3px solid currentColor;
}
.modes dt {
  font-weight: 700;
}
.modes dd {
  margin: 2px 0 0;
  font-size: 15px;
  opacity: 0.85;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
}
.host {
  font-size: 14px;
  opacity: 0.6;
}

.app-note {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 0;
  font-size: 15px;
  opacity: 0.85;
}
.app-note img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex: none;
}

/* Детекторий: папки дел на тёмно-синем сукне, манильская бумага, красный штамп */

.game-det {
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 28px),
    linear-gradient(160deg, var(--det-bg-2), var(--det-bg));
  color: #e9e3d3;
  box-shadow: inset 0 0 0 1px rgba(241, 227, 189, 0.12);
}
.game-det .kicker {
  color: var(--det-manila);
  opacity: 0.75;
}
.game-det .game-title {
  font-family: "Oswald", var(--sans);
  font-weight: 700;
  font-size: clamp(40px, 5.4vw, 64px);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--det-manila);
}
.game-det .chips,
.game-det .modes {
  color: var(--det-manila);
}
.game-det .modes dd,
.game-det .chips li {
  color: #e9e3d3;
}
.game-det .modes div {
  border-left-color: var(--det-red);
}
.btn-det {
  background: var(--det-manila);
  color: var(--det-ink);
  font-family: "Oswald", var(--sans);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 var(--det-red);
}
.btn-det:hover {
  box-shadow: 6px 6px 0 var(--det-red);
}

.det-files {
  position: relative;
  height: clamp(330px, 38vw, 470px);
}
.file {
  position: absolute;
  display: flex;
  flex-direction: column;
  width: clamp(124px, 13.5vw, 172px);
  margin: 0;
  padding: 0 8px 8px;
  background: var(--det-manila);
  border-radius: 4px;
  box-shadow: 0 22px 40px -16px rgba(0, 0, 0, 0.85);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.file::before {
  /* ярлык папки */
  content: "";
  position: absolute;
  top: -11px;
  left: 12px;
  width: 42%;
  height: 12px;
  background: var(--det-manila);
  border-radius: 6px 6px 0 0;
}
.file figcaption {
  order: -1;
  padding: 6px 2px 6px;
  color: var(--det-ink);
  font-family: "Oswald", var(--sans);
  font-weight: 500;
  font-size: 13px;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 2px;
}
.f1 {
  top: 3%;
  left: 8%;
  transform: rotate(-6deg);
}
.f2 {
  top: 0;
  left: 50%;
  transform: rotate(4deg);
}
.f3 {
  top: 44%;
  left: 16%;
  transform: rotate(3deg);
}
.f4 {
  top: 41%;
  left: 57%;
  transform: rotate(-5deg);
}
.det-files .file:hover {
  z-index: 5;
  transform: rotate(0deg) scale(1.05);
}
.stamp {
  position: absolute;
  right: 2%;
  bottom: 3%;
  z-index: 6;
  padding: 6px 12px;
  border: 3px solid var(--det-red);
  border-radius: 6px;
  color: var(--det-red);
  font-family: "Oswald", var(--sans);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.1;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
  transform: rotate(-9deg);
  background: rgba(241, 227, 189, 0.92);
  mix-blend-mode: normal;
  pointer-events: none;
}

/* Море Сна: лиловая ночь, золотые огни */

.game-dreams {
  background:
    radial-gradient(600px 400px at 85% 15%, rgba(245, 207, 122, 0.16), transparent 60%),
    linear-gradient(150deg, var(--dr-bg-2), var(--dr-bg) 70%);
  color: #e8e1fb;
  box-shadow: inset 0 0 0 1px rgba(205, 185, 255, 0.16);
}
.game-dreams .kicker {
  color: var(--dr-lilac);
}
.game-dreams .game-title {
  font-family: "Philosopher", var(--sans);
  font-weight: 700;
  font-size: clamp(44px, 6vw, 72px);
  color: var(--dr-gold);
  text-shadow: 0 0 34px rgba(245, 207, 122, 0.45);
}
.game-dreams .chips,
.game-dreams .modes {
  color: var(--dr-lilac);
}
.game-dreams .chips li,
.game-dreams .modes dd {
  color: #e8e1fb;
}
.btn-dreams {
  background: linear-gradient(135deg, #ffe3a1, var(--dr-gold) 50%, #e2a94f);
  color: #2a1a3f;
  font-family: "Philosopher", var(--sans);
  font-size: 19px;
  box-shadow: 0 0 30px -4px rgba(245, 207, 122, 0.55);
}
.btn-dreams:hover {
  box-shadow: 0 0 44px 0 rgba(245, 207, 122, 0.7);
}

.dreams-art {
  position: relative;
}
.dreams-art img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 22px;
  box-shadow:
    0 0 0 1px rgba(245, 207, 122, 0.35),
    0 0 60px -10px rgba(205, 185, 255, 0.45),
    0 30px 60px -24px rgba(0, 0, 0, 0.9);
  animation: drift 9s ease-in-out infinite;
}
.spark {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff6d8;
  box-shadow: 0 0 12px 4px rgba(245, 207, 122, 0.8);
  animation: twinkle 3.2s ease-in-out infinite;
}
.s1 { top: -10px; left: 12%; animation-delay: 0s; }
.s2 { top: 18%; right: -8px; animation-delay: 1.1s; }
.s3 { bottom: -8px; right: 30%; animation-delay: 2s; }
.s4 { bottom: 24%; left: -6px; animation-delay: 0.6s; }

@keyframes drift {
  0%, 100% { transform: translateY(0) rotate(-0.6deg); }
  50% { transform: translateY(-10px) rotate(0.6deg); }
}
@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.6); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Агора: эгейская ночь, золото и пергамент */

.game-agora {
  background:
    radial-gradient(520px 380px at 20% 50%, rgba(228, 180, 92, 0.14), transparent 65%),
    linear-gradient(200deg, var(--ag-bg-2), var(--ag-bg) 75%);
  color: #e6e0d2;
  box-shadow: inset 0 0 0 1px rgba(228, 180, 92, 0.18);
}
.game-agora::before {
  /* меандр по верхнему краю */
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 10px;
  background:
    repeating-linear-gradient(90deg, var(--ag-gold) 0 4px, transparent 4px 16px) 0 0 / 100% 2px no-repeat,
    repeating-linear-gradient(90deg, transparent 0 8px, var(--ag-gold) 8px 12px, transparent 12px 16px) 0 4px / 100% 6px no-repeat;
  opacity: 0.45;
}
.game-agora .kicker {
  color: var(--ag-gold);
}
.game-agora .game-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 700;
  font-size: clamp(52px, 7vw, 84px);
  letter-spacing: 0.02em;
  color: var(--ag-parch);
}
.game-agora .chips,
.game-agora .modes {
  color: var(--ag-gold);
}
.game-agora .chips li,
.game-agora .modes dd {
  color: #e6e0d2;
}
.btn-agora {
  background: var(--ag-gold);
  color: #1b1408;
  box-shadow: 0 10px 30px -12px rgba(228, 180, 92, 0.8);
}

.agora-gods {
  position: relative;
  height: clamp(320px, 38vw, 470px);
}
.god {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(130px, 14.5vw, 184px);
  border-radius: 12px;
  box-shadow:
    0 0 0 1px rgba(228, 180, 92, 0.4),
    0 26px 50px -18px rgba(0, 0, 0, 0.9);
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s;
}
.g1 {
  transform: translate(-125%, -46%) rotate(-10deg);
}
.g2 {
  z-index: 2;
  transform: translate(-50%, -54%) scale(1.06);
  box-shadow:
    0 0 0 1px rgba(228, 180, 92, 0.6),
    0 0 50px -6px rgba(228, 180, 92, 0.5),
    0 30px 60px -18px rgba(0, 0, 0, 0.9);
}
.g3 {
  transform: translate(25%, -46%) rotate(10deg);
}
.agora-gods:hover .g1 {
  transform: translate(-138%, -48%) rotate(-14deg);
}
.agora-gods:hover .g3 {
  transform: translate(38%, -48%) rotate(14deg);
}
.agora-gods:hover .g2 {
  transform: translate(-50%, -58%) scale(1.1);
}

/* ───── как играть ───── */

.how {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(64px, 10vw, 120px) var(--gutter) clamp(48px, 8vw, 96px);
  scroll-margin-top: 60px;
}
.how h2 {
  margin: 0 0 36px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(28px, 3.6vw, 40px);
}
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.steps li {
  padding: 26px;
  border-radius: 22px;
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.face {
  width: 46px;
  height: 46px;
  margin-bottom: 16px;
}
.face rect {
  fill: var(--ink);
}
.face circle {
  fill: var(--bg);
}
.steps li:nth-child(1) .face { transform: rotate(-8deg); }
.steps li:nth-child(2) .face { transform: rotate(6deg); }
.steps li:nth-child(3) .face { transform: rotate(-4deg); }
.steps h3 {
  margin: 0 0 6px;
  font-size: 20px;
}
.steps p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

/* ───── подвал ───── */

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px var(--gutter);
  padding-bottom: max(28px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}
.foot p {
  margin: 0;
}
.brand-small {
  font-size: 16px;
  color: var(--ink);
}
.brand-small .die {
  width: 24px;
  height: 24px;
}

/* ───── адаптив ───── */

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
    text-align: center;
  }
  .lead {
    margin-left: auto;
    margin-right: auto;
  }
  .hero-fan {
    height: 300px;
  }
  .game {
    grid-template-columns: 1fr;
  }
  .game:nth-child(even) .game-visual {
    order: 0;
  }
  .steps {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 16px;
  }
  .nav a {
    padding: 6px 8px;
    font-size: 14px;
  }
  .hero-fan {
    height: 250px;
  }
  .fan-card {
    width: 132px;
  }
  .det-files {
    height: 330px;
  }
  .file {
    width: 124px;
    padding: 0 6px 6px;
  }
  .file figcaption {
    font-size: 11px;
    letter-spacing: 0.01em;
  }
  .stamp {
    font-size: 12px;
    right: 0;
    bottom: 0;
  }
  .agora-gods {
    height: 290px;
  }
  .god {
    width: 118px;
  }
  .btn {
    width: 100%;
    justify-content: center;
  }
  .actions {
    justify-content: center;
    text-align: center;
  }
  .actions .host {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
