/* ==========================================================================
   CSS 3D objeler ve oyun çizimleri
   Harici model yok: katmanlı HTML + transform/perspective + özgün SVG.
   ========================================================================== */

/* --- Süzülme --- */

.float {
  animation: float 6s var(--ease-in-out) infinite;
  transform-style: preserve-3d;
}

.float--b { animation-duration: 7s; animation-delay: -2s; }
.float--c { animation-duration: 8s; animation-delay: -4s; }
.float--d { animation-duration: 5.5s; animation-delay: -1s; }
.float--e { animation-duration: 6.5s; animation-delay: -3s; }

@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -5%, 0); }
}

/* ==========================================================================
   Pai — PAIVU maskotu. Boyut font-size ile: .pai { --pai-size: 160px }
   Gözler JS ile --look-x / --look-y üzerinden imleci takip eder.
   ========================================================================== */

.pai {
  --look-x: 0;
  --look-y: 0;
  position: relative;
  width: 1em;
  height: 1em;
  font-size: var(--pai-size, 160px);
}

.pai__body {
  position: absolute;
  inset: 0;
  border-radius: 34%;
  background: linear-gradient(160deg, #DDFB9F 0%, var(--c-accent) 40%, #A9D44E 100%);
  box-shadow:
    inset -0.05em -0.07em 0 rgba(0, 0, 0, 0.13),
    inset 0.035em 0.045em 0 rgba(255, 255, 255, 0.4),
    0 0.16em 0.28em -0.1em rgba(0, 0, 0, 0.7);
}

.pai__body::before,
.pai__body::after {
  content: "";
  position: absolute;
  top: 36%;
  width: 0.09em;
  height: 0.26em;
  border-radius: 0.045em;
  background: linear-gradient(90deg, #2A2D33, #1B1D21);
  box-shadow: inset 0 0.01em 0 rgba(255, 255, 255, 0.08);
}

.pai__body::before { left: -0.05em; }
.pai__body::after { right: -0.05em; }

.pai__antenna {
  position: absolute;
  bottom: 100%;
  left: 50%;
  width: 0.035em;
  height: 0.13em;
  margin-left: -0.0175em;
  border-radius: 0.02em 0.02em 0 0;
  background: #9CC844;
  transform-origin: bottom center;
  animation: antenna 4s var(--ease-in-out) infinite;
}

.pai__antenna::after {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  width: 0.085em;
  height: 0.085em;
  margin-left: -0.0425em;
  border-radius: 50%;
  background: var(--c-accent);
  box-shadow: inset -0.012em -0.015em 0 rgba(0, 0, 0, 0.15), inset 0.01em 0.012em 0 rgba(255, 255, 255, 0.5);
}

@keyframes antenna {
  0%, 100% { transform: rotate(-6deg); }
  50% { transform: rotate(6deg); }
}

.pai__visor {
  position: absolute;
  top: 22%;
  left: 13%;
  right: 13%;
  height: 46%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.045em;
  overflow: hidden;
  border-radius: 0.15em;
  background: #141619;
  box-shadow: inset 0 0.02em 0.05em rgba(0, 0, 0, 0.7), 0 0.012em 0 rgba(255, 255, 255, 0.35);
}

.pai__visor::before {
  content: "";
  position: absolute;
  top: 8%;
  left: 8%;
  width: 40%;
  height: 22%;
  border-radius: 0.1em;
  background: rgba(255, 255, 255, 0.05);
  transform: skewX(-18deg);
}

.pai__eyes {
  display: flex;
  gap: 0.13em;
  transform: translate(calc(var(--look-x) * 0.035em), calc(var(--look-y) * 0.025em));
  transition: transform 120ms linear;
}

.pai__eye {
  width: 0.095em;
  height: 0.14em;
  border-radius: 0.05em;
  background: var(--c-accent);
  animation: blink 5s infinite;
}

.pai__eye + .pai__eye {
  animation-delay: 0.03s;
}

@keyframes blink {
  0%, 92%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.1); }
}

.pai__mouth {
  width: 0.11em;
  height: 0.045em;
  border: 0.018em solid var(--c-accent);
  border-top: 0;
  border-radius: 0 0 0.08em 0.08em;
  transform: translate(calc(var(--look-x) * 0.02em), calc(var(--look-y) * 0.015em));
  transition: transform 120ms linear;
}

.pai__shadow {
  position: absolute;
  left: 15%;
  right: 15%;
  top: 112%;
  height: 0.1em;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.55), transparent);
  animation: shadow 6s var(--ease-in-out) infinite;
}

@keyframes shadow {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.82); opacity: 0.7; }
}

/* ==========================================================================
   Zar — 6 yüzlü gerçek CSS küp
   ========================================================================== */

.dice-wrap {
  position: relative;
  width: 1em;
  height: 1em;
  font-size: var(--dice-size, 72px);
  perspective: 8em;
}

.dice {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(-24deg) rotateY(-36deg);
  animation: dice-spin 18s linear infinite;
}

@keyframes dice-spin {
  from { transform: rotateX(-24deg) rotateY(0deg) rotateZ(0deg); }
  50% { transform: rotateX(-14deg) rotateY(180deg) rotateZ(8deg); }
  to { transform: rotateX(-24deg) rotateY(360deg) rotateZ(0deg); }
}

.dice__face {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  padding: 0.15em;
  border-radius: 0.14em;
  background: #F3F3F1;
  box-shadow:
    inset 0 0 0 0.012em rgba(0, 0, 0, 0.08),
    inset -0.04em -0.05em 0.08em rgba(0, 0, 0, 0.12),
    inset 0.03em 0.03em 0.05em rgba(255, 255, 255, 0.8);
  backface-visibility: hidden;
}

.dice__face--1 { transform: translateZ(0.5em); }
.dice__face--6 { transform: rotateY(180deg) translateZ(0.5em); }
.dice__face--3 { transform: rotateY(90deg) translateZ(0.5em); }
.dice__face--4 { transform: rotateY(-90deg) translateZ(0.5em); }
.dice__face--2 { transform: rotateX(90deg) translateZ(0.5em); }
.dice__face--5 { transform: rotateX(-90deg) translateZ(0.5em); }

.dice__core {
  position: absolute;
  inset: 0.04em;
  background: #DCDCD8;
  transform-style: preserve-3d;
}

.dice__core::before,
.dice__core::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #DCDCD8;
}

.dice__core::before { transform: rotateY(90deg); }
.dice__core::after { transform: rotateX(90deg); }

.pip {
  width: 0.17em;
  height: 0.17em;
  border-radius: 50%;
  place-self: center;
  background: #15171A;
  box-shadow: inset 0 0.02em 0.02em rgba(0, 0, 0, 0.6), 0 0.01em 0 rgba(255, 255, 255, 0.7);
}

.pip--accent {
  width: 0.24em;
  height: 0.24em;
  background: var(--c-accent-deep);
}

.pip--tl { grid-area: 1 / 1; }
.pip--tr { grid-area: 1 / 3; }
.pip--ml { grid-area: 2 / 1; }
.pip--c  { grid-area: 2 / 2; }
.pip--mr { grid-area: 2 / 3; }
.pip--bl { grid-area: 3 / 1; }
.pip--br { grid-area: 3 / 3; }

.dice-shadow {
  position: absolute;
  left: 5%;
  right: 5%;
  top: 125%;
  height: 0.16em;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.5), transparent);
}

/* ==========================================================================
   Çipler
   ========================================================================== */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.65em 1em;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-full);
  background: var(--c-surface-2);
  box-shadow: var(--shadow-lg), var(--edge-light);
  color: var(--c-text);
  font-family: var(--font-display);
  font-size: var(--chip-size, 14px);
  font-weight: 700;
  white-space: nowrap;
}

.chip .icon {
  width: 1.15em;
  height: 1.15em;
}

.chip--accent {
  color: var(--c-accent);
}

.chip__dot {
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  background: var(--c-accent);
}

/* ==========================================================================
   Oyun çizimleri (SVG)
   ========================================================================== */

.art {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.art__label {
  fill: var(--c-text);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
}

.art__label--accent {
  fill: var(--c-accent);
}

.art__chip {
  animation: float 5s var(--ease-in-out) infinite;
}

/* ZAP! — buton nabız gibi atar, dalgalar yayılır */
.art-zap__wave {
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  animation: zap-wave 2.6s var(--ease-out) infinite;
}

.art-zap__wave--late {
  animation-delay: 1.3s;
}

@keyframes zap-wave {
  0% { transform: scale(0.85); opacity: 0.7; }
  100% { transform: scale(1.55); opacity: 0; }
}

.art-zap__cap {
  animation: zap-press 2.6s var(--ease-in-out) infinite;
}

@keyframes zap-press {
  0%, 70%, 100% { transform: translateY(0); }
  78% { transform: translateY(7px); }
  86% { transform: translateY(0); }
}

.art-zap__sparks {
  opacity: 0.85;
  animation: pulse 2.6s var(--ease-in-out) infinite;
}

/* SYNC — balonlar birbirine yaklaşıp uzaklaşır */
.art-sync__a { animation: sync-a 4.5s var(--ease-in-out) infinite; }
.art-sync__b { animation: sync-b 4.5s var(--ease-in-out) infinite; }

@keyframes sync-a {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(5px, 3px); }
}

@keyframes sync-b {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-5px, -3px); }
}

.art-sync__badge {
  transform-box: fill-box;
  transform-origin: center;
  animation: sync-badge 4.5s var(--ease-in-out) infinite;
}

@keyframes sync-badge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

/* KİM? — taç süzülür, kazanan sütun hafifçe yükselir */
.art-who__crown {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: crown 3.2s var(--ease-in-out) infinite;
}

@keyframes crown {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-4px) rotate(4deg); }
}

.art-who__bar {
  transform-box: fill-box;
  transform-origin: center bottom;
  transition: transform 700ms var(--ease-spring);
}

.art-who__star {
  animation: float 4s var(--ease-in-out) infinite;
}

.game-card:hover .art-who__bar--top {
  transform: scaleY(1.08);
}

/* ==========================================================================
   Hero sahnesi: 3D yelpaze halinde oyun kartları
   Ölçüler konteyner genişliğine (cqi) göre; her ekranda aynı kompozisyon.
   ========================================================================== */

.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 0.92;
  container-type: inline-size;
  perspective: 1600px;
}

.stage__rig {
  --rx: 7deg;
  --ry: -13deg;
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
}

.stage__item {
  position: absolute;
  transform-style: preserve-3d;
  transform: translateZ(var(--z, 0)) rotate(var(--rot, 0deg));
}

.stage__item--zap  { left: 0;   top: 20%; width: 45%; --z: -3cqi; --rot: -7deg; }
.stage__item--who  { right: 0;  top: 25%; width: 45%; --z: -5cqi; --rot: 7deg; }
.stage__item--sync { left: 26%; top: 4%;  width: 49%; --z: 7cqi;  --rot: -1deg; }
.stage__item--pai  { left: 2%;  top: 73%; --z: 16cqi; --pai-size: 20cqi; }
.stage__item--c1   { right: 9%; top: 5%;  --z: 14cqi; --chip-size: 2.8cqi; }
.stage__item--c2   { right: 5%; top: 76%; --z: 20cqi; --chip-size: 3cqi; }
.stage__item--c3   { left: 40%; top: 83%; --z: 11cqi; --chip-size: 2.6cqi; }

.gcard {
  overflow: hidden;
  border: 1px solid var(--c-border-strong);
  border-radius: 4.2cqi;
  background: var(--c-surface);
  box-shadow: var(--shadow-xl), var(--edge-light);
}

.gcard__art {
  aspect-ratio: 320 / 220;
  padding: 1.5cqi;
  background:
    linear-gradient(var(--c-border) 1px, transparent 1px) 0 0 / 3.2cqi 3.2cqi,
    linear-gradient(90deg, var(--c-border) 1px, transparent 1px) 0 0 / 3.2cqi 3.2cqi,
    var(--c-surface-2);
  border-bottom: 1px solid var(--c-border);
}

.gcard__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2.2cqi 3cqi;
  font-size: 2.4cqi;
}

.gcard__name {
  font-family: var(--font-display);
  font-size: 1.45em;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.gcard__meta {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  color: var(--c-muted);
}

.gcard__meta .icon {
  width: 1.2em;
  height: 1.2em;
}

/* --- Ses dalgası çubukları (konuşuyor göstergesi) --- */

.eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.eq span {
  width: 3px;
  height: 30%;
  border-radius: 2px;
  background: var(--c-border-strong);
}

.is-talking .eq span {
  background: var(--c-accent);
  animation: eq 0.9s var(--ease-in-out) infinite;
}

.is-talking .eq span:nth-child(2) { animation-delay: -0.3s; }
.is-talking .eq span:nth-child(3) { animation-delay: -0.6s; }
.is-talking .eq span:nth-child(4) { animation-delay: -0.15s; }

@keyframes eq {
  0%, 100% { height: 25%; }
  50% { height: 100%; }
}
