/* Oyunlar: apps/shared/style.css-in üzərinə əlavələr */

/* ---------- Oyun səhifəsi ---------- */

.game-page { max-width: 720px; }
.game-page .top { margin: 24px 0 20px; text-align: center; }
.game-page .lead { margin: 0 auto; }

/* Xal, rekord və düymələr sırası */
.hud {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 16px;
}

.stat {
  display: grid;
  min-width: 84px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-align: center;
}
.stat span { color: var(--muted); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.stat strong { font-size: 1.15rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.3; }
.stat.bump strong { animation: bump 0.3s; }
@keyframes bump { 40% { transform: scale(1.15); color: var(--good); } }

.play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
}
.play:hover { opacity: 0.88; }
.play:active { transform: scale(0.97); }
.play:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.play svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hud .play { align-self: center; }

.game-page .seg { width: fit-content; margin: 0 auto 16px; }

/* Oyun meydançası və üstündəki mesaj */
.stage { position: relative; margin: 0 auto; }

.overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding: 20px;
  border-radius: inherit;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  text-align: center;
  animation: fade 0.25s;
}
.overlay[hidden] { display: none; }
.overlay h2 { font-family: "Playfair Display", Georgia, serif; font-size: clamp(1.8rem, 6vw, 2.4rem); font-weight: 400; line-height: 1.1; }
.overlay p { margin: 0; color: var(--muted); }
@keyframes fade { from { opacity: 0; } }

.howto { max-width: 560px; margin: 24px auto 0; color: var(--muted); font-size: 0.88rem; text-align: center; }
.howto kbd {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface);
  font: inherit;
  font-size: 0.8rem;
}

/* ---------- Oyunlar siyahısı ---------- */

.home { max-width: 1040px; padding-bottom: 32px; }
body.hub { min-height: 100vh; min-height: 100svh; }

/* Yuxarıda zəif rəngli fon parıltısı */
body.hub::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 560px;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(40% 70% at 12% 0%, color-mix(in srgb, var(--good) 13%, transparent), transparent 70%),
    radial-gradient(35% 60% at 55% 0%, color-mix(in srgb, var(--fee) 11%, transparent), transparent 70%),
    radial-gradient(35% 65% at 92% 5%, color-mix(in srgb, var(--warn) 11%, transparent), transparent 70%);
}

.intro { padding: 40px 0 28px; }
.intro h1 { margin: 0 0 10px; font-size: clamp(2.6rem, 9vw, 4rem); }
.intro .lead { max-width: 520px; margin: 0; }

.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.tools li { display: flex; }

.tool {
  --accent: var(--brand);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(70% 90% at 100% 0%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 65%),
    var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.tool::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent 85%);
  opacity: 0.55;
  transition: opacity 0.25s;
}
.tool::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(90% 120% at 100% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%);
  opacity: 0;
  transition: opacity 0.25s;
}
.tool:hover {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
  box-shadow: 0 14px 36px -14px color-mix(in srgb, var(--accent) 45%, transparent);
  transform: translateY(-4px);
}
.tool:hover::before, .tool:hover::after { opacity: 1; }
.tool:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.tool-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 14px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--accent);
  transition: background-color 0.25s, color 0.25s, transform 0.25s;
}
.tool-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tool:hover .tool-icon { background: var(--accent); color: #fff; transform: rotate(-4deg) scale(1.05); }

.tool-arrow {
  position: absolute;
  top: 28px;
  right: 28px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  transition: background-color 0.25s, border-color 0.25s, color 0.25s;
}
.tool-arrow svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.25s; }
.tool:hover .tool-arrow { border-color: var(--accent); background: var(--accent); color: #fff; }
.tool:hover .tool-arrow svg { transform: translate(2px, -2px); }

.tool-name { font-family: "Playfair Display", Georgia, serif; font-size: clamp(1.45rem, 4vw, 1.75rem); line-height: 1.2; }
.tool-desc { color: var(--muted); font-size: 0.95rem; line-height: 1.55; }
.tool-best { margin-top: auto; padding-top: 6px; color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.tool-best:empty { display: none; }

.home .foot { display: flex; flex-direction: row; justify-content: space-between; align-items: center; margin-top: 40px; text-align: left; }
.foot-links { display: flex; align-items: center; gap: 16px; }
.foot-link { color: var(--muted); text-decoration: none; transition: color 0.15s; }
.foot-link:hover { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  .tool, .tool-icon, .tool-arrow svg { transition: none; }
  .tool:hover, .tool:hover .tool-icon, .tool:hover .tool-arrow svg { transform: none; }
  .stat.bump strong, .overlay { animation: none; }
}

@media (max-width: 520px) {
  .intro { padding: 24px 0 20px; }
  .tools { gap: 12px; }
  .tool { padding: 22px; }
  .tool-arrow { top: 22px; right: 22px; }
  .stat { min-width: 72px; padding: 6px 10px; }
}
