/* Tinkeroll — Parça Kutusu alt sayfası */
.pp { background: #2b2a6e; color: #fff; }

/* Bölüme göre değişen zemin: katmanlar üst üste, etkin olan görünür */
.bg { position: fixed; inset: 0; z-index: 0; }
.bg i { position: absolute; inset: 0; opacity: 0; transition: opacity 1.1s cubic-bezier(.2,.8,.2,1); }
.bg i[data-for="intro"]   { background: radial-gradient(70% 80% at 72% 55%, #8b6cf0 0%, rgba(139,108,240,0) 70%), linear-gradient(115deg, #1d1b4f 0%, #3a2f8f 45%, #e38a77 100%); }
.bg i[data-for="booster"] { background: radial-gradient(70% 80% at 72% 55%, #ffb067 0%, rgba(255,176,103,0) 70%), linear-gradient(115deg, #6b1d0b 0%, #c2410c 48%, #ff9a4a 100%); }
.bg i[data-for="brake"]   { background: radial-gradient(70% 80% at 72% 55%, #ff8f7a 0%, rgba(255,143,122,0) 70%), linear-gradient(115deg, #4a0f22 0%, #a8233a 50%, #f07a5a 100%); }
.bg i[data-for="bridge"]  { background: radial-gradient(70% 80% at 72% 55%, #8fe0e6 0%, rgba(143,224,230,0) 70%), linear-gradient(115deg, #082f4a 0%, #0f6b8f 50%, #63c7c2 100%); }
.bg i[data-for="seesaw"]  { background: radial-gradient(70% 80% at 72% 55%, #e4a8ff 0%, rgba(228,168,255,0) 70%), linear-gradient(115deg, #1e1550 0%, #5b3fc4 50%, #d68cf0 100%); }
.bg i[data-for="lift"]    { background: radial-gradient(70% 80% at 72% 55%, #c9eaa0 0%, rgba(201,234,160,0) 70%), linear-gradient(115deg, #0c3328 0%, #2c7a5c 50%, #a9d48a 100%); }
.pp[data-piece="intro"] .bg i[data-for="intro"], .pp[data-piece="end"] .bg i[data-for="intro"],
.pp[data-piece="booster"] .bg i[data-for="booster"], .pp[data-piece="brake"] .bg i[data-for="brake"],
.pp[data-piece="bridge"] .bg i[data-for="bridge"], .pp[data-piece="seesaw"] .bg i[data-for="seesaw"],
.pp[data-piece="lift"] .bg i[data-for="lift"] { opacity: 1; }

/* Tablanın arkasındaki dev parça adı */
.ghost {
  position: fixed; right: -2vw; bottom: -3vw; z-index: 0; pointer-events: none; overflow: hidden;
  font-size: clamp(120px, 23vw, 420px); font-weight: 700; letter-spacing: -.07em; line-height: .8;
  color: transparent; -webkit-text-stroke: 1.5px rgba(255,255,255,.22);
  padding: .04em .1em .08em;
}
.ghost-in { display: block; transition: transform .8s cubic-bezier(.76,0,.24,1), opacity .5s; }
.ghost.swap .ghost-in { transform: translateY(105%); opacity: 0; transition-duration: .45s; }

#board { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; display: block; }
.pp main, .pp .foot { position: relative; z-index: 2; }
.pp main { pointer-events: none; }
.pp main a, .pp main button, .pp .pc-copy > * { pointer-events: auto; }
.pp .foot { background: var(--paper); color: var(--ink); }

/* Başlık rengi */
.pp .nav-in { color: #fff; }
.pp .nav .btn.small { --bg: #fff; --fg: var(--ink); }
.pp .nav::before { background: linear-gradient(rgba(10,8,30,.4), rgba(10,8,30,0)); }
.pp .menu-toggle { background: #fff; } .pp .menu-toggle i { background: var(--ink); }
.pp .cursor::before { background: #fff; }
.pp .cursor i { border-color: rgba(255,255,255,.55); }
.pp .cursor.big i { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.7); }
.pp .nav-links a::before { background: #ffc23a; }

/* ---------- Bölümler ---------- */
.pc { position: relative; min-height: 165vh; padding: 0 max(20px, 5vw); }
.pc-copy {
  position: sticky; top: 0; height: 100vh; width: min(500px, 38vw);
  display: flex; flex-direction: column; justify-content: center; padding: 96px 0 40px;
}
.pc-hero { min-height: 130vh; }
.pc-hero .pc-copy, .pc-end .pc-copy { width: min(640px, 46vw); }
.pc .eyebrow { opacity: .75; }
.pc-mega { font-size: clamp(52px, 6.6vw, 124px); line-height: .88; letter-spacing: -.06em; font-weight: 600; }
.pc-mega em { font-weight: 300; }
.pc-title { font-size: clamp(76px, 8.6vw, 164px); line-height: .84; letter-spacing: -.065em; font-weight: 600; margin-left: -.04em; }
.pc-lede { margin-top: 28px; max-width: 40ch; font-size: clamp(17px, 1.3vw, 20px); line-height: 1.5; opacity: .9; }
.pc-tag { margin-top: 20px; font-size: clamp(20px, 1.7vw, 26px); line-height: 1.25; letter-spacing: -.02em; font-weight: 500; }
.pc-body { margin-top: 14px; font-size: 16px; line-height: 1.6; opacity: .82; max-width: 44ch; }

.spec { margin: 26px 0 0; display: grid; gap: 0; max-width: 420px; }
.spec div { display: grid; grid-template-columns: 140px 1fr; align-items: center; padding: 11px 0; border-top: 1px solid rgba(255,255,255,.2); }
.spec div:last-child { border-bottom: 1px solid rgba(255,255,255,.2); }
.spec dt { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; opacity: .7; }
.spec dd { margin: 0; display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 500; }
.meter { position: relative; width: 74px; height: 6px; border-radius: 6px; background: rgba(255,255,255,.2); overflow: hidden; flex: none; }
.meter i { position: absolute; inset: 0; border-radius: 6px; background: #fff; transform-origin: left; transform: scaleX(0); transition: transform 1.2s cubic-bezier(.2,.8,.2,1) .3s; }
.spec.in .meter i { transform: scaleX(var(--v)); }

.task {
  margin-top: 26px; display: inline-flex; align-items: center; flex-wrap: wrap; gap: 12px; align-self: flex-start;
  padding: 12px 18px 12px 12px; border-radius: 999px; font-size: 15px; font-weight: 500; line-height: 1.3;
  background: rgba(255,255,255,.14); box-shadow: inset 0 0 0 1px rgba(255,255,255,.28);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.task-k { padding: 6px 10px; border-radius: 999px; background: #fff; color: var(--ink); font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.task-ok {
  display: none; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px;
  background: #ffc23a; color: #3a2400; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 500;
}
.task-ok::before { content: ""; width: 10px; height: 6px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(-45deg); }
.pc.solved .task-ok { display: inline-flex; animation: okpop .6s cubic-bezier(.2,1.6,.4,1); }
@keyframes okpop { from { transform: scale(.4); opacity: 0; } }

/* Kontroller */
.ctrl { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 10px; }
.ctrl li { display: flex; align-items: center; gap: 14px; font-size: 15px; opacity: .9; }
.ctrl li:nth-child(2) { transition-delay: .08s; } .ctrl li:nth-child(3) { transition-delay: .16s; }
.key {
  display: inline-grid; place-items: center; min-width: 38px; height: 32px; padding: 0 10px; border-radius: 9px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em; background: rgba(255,255,255,.14); box-shadow: inset 0 0 0 1px rgba(255,255,255,.3), 0 2px 0 rgba(0,0,0,.18);
}
.key.mouse { min-width: 0; width: 22px; height: 32px; padding: 0; border-radius: 11px; position: relative; }
.key.mouse i { position: absolute; left: 50%; top: 7px; width: 2px; height: 6px; margin-left: -1px; border-radius: 2px; background: #fff; animation: wheel 1.6s ease-in-out infinite; }
@keyframes wheel { 50% { transform: translateY(5px); opacity: .3; } }
.pc-cue { margin-top: 7vh; display: flex; align-items: center; gap: 14px; }
.pc-cue .label { color: inherit; opacity: .8; }
.pc-cue i { width: 64px; height: 1px; background: rgba(255,255,255,.5); position: relative; overflow: hidden; }
.pc-cue i::after { content: ""; position: absolute; inset: 0; background: #fff; transform: translateX(-100%); animation: cue3 1.8s cubic-bezier(.76,0,.24,1) infinite; }
@keyframes cue3 { to { transform: translateX(100%); } }

.pc-end { min-height: 120vh; }
.pc-end-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.pc-end .btn.light { --bg: rgba(255,255,255,.16); --fg: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }

/* ---------- Gösterge ---------- */
.hud {
  position: fixed; right: max(16px, 2.4vw); bottom: max(16px, 2.4vw); z-index: 30;
  display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 999px;
  background: rgba(14,12,40,.38); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: opacity .4s, transform .5s cubic-bezier(.2,.8,.2,1);
}
.hud.gone { opacity: 0; transform: translateY(20px); pointer-events: none; }
.hud > div { display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 38px; font-variant-numeric: tabular-nums; }
.hud-k { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; opacity: .7; }
.hud b { font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.hud-of { margin-left: -6px; opacity: .55; font-size: 14px; }
.hud-dots { display: inline-flex; gap: 5px; margin-left: 4px; }
.hud-dots i { width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.5); transition: background .4s, box-shadow .4s, transform .4s cubic-bezier(.2,1.6,.4,1); }
.hud-dots i.on { background: #ffc23a; box-shadow: none; transform: scale(1.2); }
.hud-falls { border-left: 1px solid rgba(255,255,255,.18); }
.hud-falls.bump b { animation: bump .45s cubic-bezier(.2,1.6,.4,1); display: inline-block; }
@keyframes bump { 40% { transform: translateY(-5px) scale(1.25); color: #ffb067; } }
.hud-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border: 0; border-radius: 999px; cursor: pointer;
  background: #fff; color: var(--ink); font: 500 14px/1 var(--sans);
}
.hud-btn svg { width: 15px; height: 15px; }
.hud-btn kbd { font-family: var(--mono); font-size: 10px; padding: 3px 6px; border-radius: 5px; background: rgba(21,19,15,.08); }
.hud-btn:hover svg { transform: rotate(-120deg); transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.hud-btn.gyro { background: #ffc23a; }
.hud-btn.gyro.on { background: rgba(255,255,255,.2); color: #fff; }

/* Dokunmatik eğme alanı (yalnız dokunmatik ekranlarda görünür) */
.pad { display: none; }
.t-only { display: none !important; }

/* Çözülünce ekran hafifçe parlar */
.flash { position: fixed; inset: 0; z-index: 3; pointer-events: none; background: radial-gradient(60% 60% at 70% 55%, rgba(255,214,120,.45), rgba(255,214,120,0) 70%); opacity: 0; }
.flash.go { animation: flash 1.2s ease-out; }
@keyframes flash { 15% { opacity: 1; } }

@media (max-width: 1180px) and (min-width: 900px) {
  .pc-copy, .pc-hero .pc-copy, .pc-end .pc-copy { width: min(440px, 42vw); }
  .pc-mega { font-size: clamp(48px, 5.6vw, 80px); }
  .pc-title { font-size: clamp(64px, 8vw, 120px); }
}

/* ---------- Dar ekranlar: tabla üstte, yazı altta ---------- */
@media (max-width: 899px) {
  .ghost { right: auto; left: -2vw; bottom: auto; top: 12svh; font-size: 34vw; -webkit-text-stroke-width: 1px; }
  .pc, .pc-hero, .pc-end { min-height: auto; padding: 58svh 12px 14svh; }
  .pc-hero { padding-top: 56svh; }
  .pc-copy, .pc-hero .pc-copy, .pc-end .pc-copy {
    position: relative; height: auto; width: auto; padding: 26px 22px 24px; border-radius: 26px;
    background: rgba(14,12,40,.42); box-shadow: inset 0 0 0 1px rgba(255,255,255,.16);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  }
  .pc-title { font-size: clamp(60px, 18vw, 96px); }
  .pc-mega { font-size: clamp(44px, 12.5vw, 72px); }
  .spec div { grid-template-columns: 118px 1fr; }
  .hud { top: 72px; bottom: auto; right: 12px; left: auto; padding: 4px; }
  .hud > div { height: 32px; padding: 0 9px; }
  .hud b { font-size: 15px; }
  .hud-btn { height: 32px; padding: 0 11px; font-size: 13px; }
  .hud-btn kbd, .hud-dots { display: none; }
}
@media (hover: none) and (pointer: coarse) {
  .ctrl li:first-child { display: none; }
  .pad {
    display: block; position: fixed; left: 0; right: 0; top: 64px; height: calc(52svh - 64px); z-index: 3;
    touch-action: none; -webkit-user-select: none; user-select: none; transition: opacity .3s;
  }
  .pad.off { pointer-events: none; }
  .pad-hint {
    position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
    font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; opacity: .7;
    padding: 6px 10px; border-radius: 999px; background: rgba(14,12,40,.35); transition: opacity .4s;
  }
  .pad.used .pad-hint { opacity: 0; }
  .pad-knob {
    position: absolute; left: 50%; bottom: 46px; width: 44px; height: 44px; margin-left: -22px; border-radius: 50%;
    box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.55); opacity: 0; transition: opacity .25s;
    transform: translate(calc(var(--jx, 0) * 18px), calc(var(--jy, 0) * 18px));
  }
  .pad.held .pad-knob { opacity: 1; }
  .ctrl li:nth-child(2), .k-only { display: none !important; }
  .t-only { display: flex !important; }
}
@media (prefers-reduced-motion: reduce) { .ghost-in, .bg i { transition: none; } }
