/* "Хвани своя KINIK" — pençeli makine oyunu */

.game-page { background: #0d2a4a; color: #fff; overflow: hidden; }
.game-shell { height: 100svh; display: flex; flex-direction: column; }

.game-bar {
  flex: none; display: flex; align-items: center; gap: 14px;
  padding: 10px 16px; background: rgba(4, 18, 36, .55);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.game-back { color: #cfe6ff; text-decoration: none; font-weight: 700; font-size: .9rem; white-space: nowrap; }
.game-back:hover { color: #fff; }
.game-title { flex: 1; text-align: center; font-size: clamp(1rem, 2.4vw, 1.35rem); font-weight: 900; letter-spacing: -.01em; }
.game-tools { display: flex; align-items: center; gap: 8px; }
.gbtn-icon {
  width: 38px; height: 38px; border-radius: 12px; border: 0; cursor: pointer;
  background: rgba(255,255,255,.12); color: #fff; font-size: 1.05rem;
}
.gbtn-icon[aria-pressed="false"] { opacity: .4; text-decoration: line-through; }
.game-bar .langs { background: rgba(255,255,255,.12); }
.game-bar .langs a { color: #fff; }
.game-bar .langs a.is-active { color: var(--red); }

.game {
  position: relative; flex: 1; min-height: 0;
  background:
    radial-gradient(900px 600px at 30% 20%, #2f7fd0 0%, transparent 60%),
    radial-gradient(700px 500px at 90% 90%, #1a4f8c 0%, transparent 60%),
    #123b68;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.game canvas { position: absolute; inset: 0 0 86px 0; width: 100%; height: calc(100% - 86px); display: block; }

.hud {
  position: absolute; top: 10px; left: 12px; display: flex; gap: 8px; pointer-events: none;
}
.hud div {
  background: rgba(4, 18, 36, .6); border: 1px solid rgba(255,255,255,.12); border-radius: 12px;
  padding: 5px 12px; text-align: center; min-width: 64px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.hud small { display: block; font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; opacity: .75; font-weight: 700; }
.hud b { font-size: 1.15rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.hud .is-low { color: #ffb4a8; animation: blink .6s steps(2) infinite; }
@keyframes blink { 50% { opacity: .35; } }

.controls {
  position: absolute; left: 0; right: 0; bottom: 0; height: 86px;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  background: linear-gradient(transparent, rgba(4, 18, 36, .6));
}
.ctl {
  font: inherit; font-weight: 900; cursor: pointer; border: 0; color: #fff;
  height: 62px; border-radius: 20px; touch-action: none;
  box-shadow: 0 6px 0 rgba(0,0,0,.35), inset 0 2px 0 rgba(255,255,255,.25);
  transition: transform .08s, box-shadow .08s;
}
.ctl:active, .ctl.is-down { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,.35), inset 0 2px 0 rgba(255,255,255,.25); }
.ctl-dir { width: 72px; background: #2d6fb8; font-size: 1.4rem; }
.ctl-grab { min-width: 170px; padding: 0 26px; background: var(--red); font-size: 1.25rem; letter-spacing: .02em; }
.ctl[disabled] { opacity: .45; cursor: default; }

.overlay {
  position: absolute; inset: 0; z-index: 5; display: none; place-items: center; padding: 16px;
  background: rgba(6, 20, 40, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.overlay.is-open { display: grid; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; } }
.panel {
  width: min(460px, 100%); max-height: 100%; overflow: auto;
  background: #fff; color: var(--ink); border-radius: 26px; padding: 28px 26px; text-align: center;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); display: grid; gap: 14px;
  animation: popin .35s cubic-bezier(.2,.9,.3,1.3);
}
@keyframes popin { from { transform: scale(.85); opacity: 0; } }
.panel h2 { font-size: 1.7rem; font-weight: 900; }
.panel p { color: var(--ink-soft); }
.panel-kicker { font-size: .75rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; color: var(--red) !important; }
.howto { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .92rem; color: var(--ink-soft); }
kbd { display: inline-block; min-width: 26px; padding: 2px 7px; border-radius: 7px; border: 1px solid #d9cfc8; border-bottom-width: 3px; background: #faf6f2; font: inherit; font-size: .8rem; font-weight: 800; color: var(--ink); }
.panel .btn { justify-self: center; }
.btn-outline { border-color: var(--line); color: var(--ink); background: #fff; }
.over-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.over-result { font-weight: 800; font-size: 1.05rem; color: var(--ink) !important; }
.disclaimer { font-size: .75rem; opacity: .7; }

.card { width: min(640px, 100%); grid-template-columns: 180px 1fr; text-align: left; padding: 0; overflow: hidden; gap: 0; }
.card-media {
  background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--tint, #e01f1d) 40%, #fff), color-mix(in srgb, var(--tint, #e01f1d) 12%, #fff) 70%);
  display: grid; place-items: center; padding: 22px 12px;
}
.card-media img { max-height: 260px; width: auto; filter: drop-shadow(0 16px 14px rgba(0,0,0,.25)); animation: wiggle 1.2s ease-in-out 2; }
@keyframes wiggle { 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
.card-body { padding: 24px 24px 22px; display: grid; gap: 10px; align-content: start; }
.card-body h2 { font-size: 1.35rem; }
.card-fx { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.card-fx li { background: #f3f9ff; border: 1px solid #d6e8fb; border-radius: 12px; padding: 8px 12px; font-size: .92rem; font-weight: 600; animation: slidein .4s ease both; }
.card-fx li:nth-child(2) { animation-delay: .25s; } .card-fx li:nth-child(3) { animation-delay: .5s; } .card-fx li:nth-child(4) { animation-delay: .75s; }
@keyframes slidein { from { opacity: 0; transform: translateX(16px); } }
.card-hl { margin: 0; padding-left: 18px; color: var(--ink-soft); font-size: .82rem; display: grid; gap: 2px; }
.card .btn { justify-self: start; }

@media (max-width: 640px) {
  .game-back span { display: none; }
  .game-title { text-align: left; }
  .game-bar { gap: 8px; padding: 8px 10px; }
  .gbtn-icon { width: 34px; height: 34px; }
  .game canvas { inset: 0 0 78px 0; height: calc(100% - 78px); }
  .controls { height: 78px; gap: 10px; }
  .ctl { height: 56px; }
  .ctl-dir { width: 64px; }
  .ctl-grab { min-width: 130px; }
  .hud div { min-width: 54px; padding: 4px 8px; }
  .card { grid-template-columns: 1fr; text-align: center; }
  .card-media { padding: 14px; }
  .card-media img { max-height: 150px; }
  .card .btn { justify-self: center; }
  .card-hl { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .card-media img, .panel, .card-fx li { animation: none; }
}

/* Geniş ekranda kart yalnız makinenin üstünde açılır: figürün parlaması görünsün */
@media (min-aspect-ratio: 105/100) {
  .overlay[data-card] { right: 42%; }
  .overlay[data-card] .card { grid-template-columns: 150px 1fr; }
}
