/* ==========================================================================
   Mini-game styles (v3). Extends the base mini-game block in style.css.
   Visual lock (DESIGN.md §4): newsprint paper, ink, one riso red only for the
   main action and danger, 0 radius, no shadows, stamps that press in.
   ========================================================================== */

/* ---------- Shell ---------- */
.mg-card { max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; }
.mg-play { position: relative; touch-action: none; }
.mg-play button { -webkit-user-select: none; user-select: none; }
.mg-stat { text-align: center; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--ink-2); margin: -4px 0 2px; }
.mg-stat b { color: var(--ink); }
.btn.big.mg-start { flex-direction: row; gap: 8px; }
.mg-start .ic { width: 16px; height: 16px; }
.mg-hud { align-items: baseline; gap: 8px; }
.mg-hud > span { flex: 1 1 0; white-space: nowrap; }
.mg-hud .mg-t { flex: 0 0 auto; min-width: 3.2ch; text-align: center; font-size: 17px; }
.mg-hud .mg-sc { text-align: right; }
.mg-timebar i { transition: background-color .2s; }
.mg-timebar i.low { background: var(--red); }
.mg-big:disabled { background: transparent; color: var(--ink-3); outline: 2px dashed var(--ink-3); outline-offset: -2px; cursor: not-allowed; }
.mg-big:disabled:active { transform: none; }
.mg-note { font-family: var(--f-mono) !important; font-style: normal !important; font-size: 13px !important; color: var(--ink-2); border-top: var(--hair); border-bottom: var(--hair); padding: 6px 0; margin: 8px 0 0 !important; }

/* Paused (tab was hidden): game clock stops until the player taps. */
.mg-pause { position: absolute; inset: -4px; z-index: 30; background: var(--ink); color: var(--paper); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; cursor: pointer; }
.mg-pause .ic { width: 32px; height: 32px; margin-bottom: 8px; }
.mg-pause b { font-family: var(--f-display); font-weight: 400; font-size: 36px; text-transform: uppercase; letter-spacing: .04em; line-height: 1; }
.mg-pause span { font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; opacity: .75; }
.mg.paused .mg-play *, .mg.paused .mg-play *::before, .mg.paused .mg-play *::after { animation-play-state: paused !important; }

/* ---------- Feedback ---------- */
.mg-stamp {
  position: absolute; left: 50%; top: 42%; z-index: 20; pointer-events: none; white-space: nowrap;
  font-family: var(--f-display); font-weight: 400; font-size: 36px; line-height: 1.05; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink); background: var(--paper); border: 4px solid currentColor; outline: 1.5px solid currentColor; outline-offset: 3px;
  padding: 4px 14px 2px;
  transform: translate(-50%, -50%) rotate(var(--rot, -6deg));
  animation: mgStamp .36s cubic-bezier(.2, .9, .3, 1.25) both, mgFade .2s ease-in .58s forwards;
}
.mg-stamp.bad { color: var(--red); }
.mg-float {
  position: absolute; z-index: 19; pointer-events: none; white-space: nowrap;
  font-family: var(--f-mono); font-size: 15px; font-weight: 500; color: var(--ink); background: var(--paper); padding: 0 4px;
  transform: translate(-50%, -50%); animation: mgFloat .7s ease-out forwards;
}
.mg-float.bad { color: var(--red); }
.mg-shake { animation: shake .3s; }
.arena.mg-hurt { border-color: var(--red); animation: shake .3s, mgHurt .4s; }
@keyframes mgStamp {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--rot, -6deg)) scale(1.9); }
  60% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--rot, -6deg)) scale(.95); }
  100% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--rot, -6deg)) scale(1); }
}
@keyframes mgFade { to { opacity: 0; } }
@keyframes mgFloat { 0% { opacity: 0; transform: translate(-50%, -20%); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -170%); } }
@keyframes mgHurt { 30% { background-color: #F1D3CA; } }
@keyframes mgPress { 0% { transform: scale(1.6); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes mgCaret { 50% { border-bottom-color: var(--ink-3); } }

/* ---------- Penaltı ---------- */
.pdots { display: flex; justify-content: center; gap: 8px; margin-top: 10px; }
.pdots i { width: 14px; height: 14px; border: 2px solid var(--ink); }
.pdots i.g { background: var(--ink); }
.pdots i.x { border-color: var(--red); background: linear-gradient(45deg, transparent 43%, var(--red) 43% 57%, transparent 57%); }

/* ---------- Münazara ---------- */
.dq { font-size: 17.5px; }
.dans button { position: relative; min-height: 54px; font-family: var(--f-ui); font-weight: 600; font-size: 14.5px; line-height: 1.32; color: var(--ink); transition: background-color .12s, color .12s, border-color .12s; }
.dans button:active:not(:disabled) { background: var(--paper-2); }
.dans button:disabled { cursor: default; }
.dans button.mid, .dans button.weak { color: var(--ink-2); border-color: var(--ink-3); }
.dans button.best { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.dans button.pick { outline: 3px solid var(--ink); outline-offset: 3px; }
.dans button.pick.weak { outline-color: var(--red); }
.dans .dl { display: block; font-family: var(--f-mono); font-size: 10.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 3px; }
.dans .weak .dl { color: var(--red); }

/* ---------- Hafıza ---------- */
.mem { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; perspective: 900px; }
.mem-c { position: relative; aspect-ratio: 5 / 6; padding: 0; border: 0; background: none; color: var(--ink); }
.mem.r4 .mem-c { aspect-ratio: 1; }
.mem-in { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .3s cubic-bezier(.3, .7, .3, 1.1); }
.mem-c.up .mem-in, .mem-c.done .mem-in { transform: rotateY(180deg); }
.mem-b, .mem-f { position: absolute; inset: 0; display: grid; place-items: center; -webkit-backface-visibility: hidden; backface-visibility: hidden; border: var(--rule); }
.mem-b { background-color: var(--ink); background-image: radial-gradient(var(--ink-2) 1.1px, transparent 1.5px); background-size: 7px 7px; outline: 1.5px solid var(--paper); outline-offset: -7px; }
.mem-b b { font-family: var(--f-display); font-weight: 400; font-size: 24px; line-height: 1.15; color: var(--paper); background: var(--ink); padding: 0 6px; }
.mem-f { background: var(--paper); transform: rotateY(180deg); transition: background-color .15s, color .15s, border-color .15s; }
.mem-f .ic { width: 34px; height: 34px; }
.mem-c.no .mem-f { border-color: var(--red); color: var(--red); }
.mem-c.done .mem-f { background: var(--paper-2); color: var(--ink-2); border-color: var(--ink-3); }
.mem-c.hit .mem-f { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- Dizgi ---------- */
.dz-copy { text-align: center; border-bottom: var(--hair); padding-bottom: 6px; margin-bottom: 10px; }
.dz-copy small { display: block; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--ink-2); }
.dz-copy b { display: block; font-family: var(--f-display); font-weight: 400; font-size: 40px; letter-spacing: .06em; line-height: 1.12; }
.dz-stick { display: flex; justify-content: center; gap: 5px; padding: 8px 6px 6px; border: var(--rule); background: var(--paper-2); margin-bottom: 12px; transition: background-color .2s, color .2s; }
.dz-stick.done { background: var(--ink); color: var(--paper); }
.dz-s { width: 38px; height: 46px; border-bottom: 3px solid var(--ink-3); display: grid; place-items: center; font-family: var(--f-display); font-size: 32px; line-height: 1; }
.dz-s.next { border-bottom-color: var(--ink); animation: mgCaret 1s steps(1) infinite; }
.dz-s.on { border-bottom-color: currentColor; animation: mgPress .2s cubic-bezier(.2, .9, .3, 1.3); }
.dz-case { display: grid; grid-template-columns: repeat(4, 1fr); border: var(--rule); background: var(--paper-2); }
.dz-cell { aspect-ratio: 1.15; display: grid; place-items: center; border-right: var(--hair); border-bottom: var(--hair); }
.dz-cell:nth-child(4n) { border-right: 0; }
.dz-cell:nth-last-child(-n+4) { border-bottom: 0; }
.dz-t { width: 74%; aspect-ratio: 1; border: 0; padding: 0; background: var(--ink); color: var(--paper); position: relative; display: grid; place-items: center; transform: translate(var(--x, 0), var(--y, 0)) rotate(var(--r, 0deg)); transition: transform .08s, background-color .08s; }
.dz-t b { font-family: var(--f-display); font-weight: 400; font-size: 30px; line-height: 1; }
.dz-t::after { content: ''; position: absolute; left: 14%; right: 14%; bottom: 9%; height: 2px; background: var(--ink-2); }
.dz-t:active { transform: translate(var(--x, 0), var(--y, 0)) rotate(var(--r, 0deg)) scale(.9); }
.dz-t.used { visibility: hidden; }
.dz-t.no { background: var(--red); animation: shake .3s; }

/* ---------- Pazarlık ---------- */
.pz-item { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.pz-ic { width: 48px; height: 48px; border: var(--rule); display: grid; place-items: center; flex: none; }
.pz-ic .ic { width: 26px; height: 26px; }
.pz-item b { display: block; font-family: var(--f-display); font-weight: 400; font-size: 22px; text-transform: uppercase; line-height: 1.05; }
.pz-item small { font-family: var(--f-mono); font-size: 13px; color: var(--ink-2); }
.pz-say { display: flex; gap: 10px; align-items: center; background: var(--paper-2); border-left: 6px solid var(--ink); padding: 8px 10px; min-height: 60px; }
.pz-say[data-z="0"] { border-left-color: var(--red); }
.pz-say[data-z="0"] p { color: var(--red); }
.pz-who { width: 36px; height: 36px; background: var(--ink); color: var(--paper); display: grid; place-items: center; flex: none; }
.pz-who .ic { width: 20px; height: 20px; }
.pz-say p { margin: 0; font-family: var(--f-serif); font-style: italic; font-size: 19px; line-height: 1.2; }
.pz-scale { position: relative; height: 56px; margin-top: 34px; border: var(--rule); background-color: var(--paper); background-image: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), var(--ink-3) calc(10% - 1px) 10%); }
.pz-band, .pz-over { position: absolute; top: 0; bottom: 0; opacity: 0; transition: opacity .25s; }
.pz-band { background: repeating-linear-gradient(45deg, var(--ink) 0 2px, transparent 2px 7px); border-left: 3px solid var(--ink); border-right: 2px solid var(--ink); }
.pz-over { background: repeating-linear-gradient(-45deg, var(--ink-3) 0 1px, transparent 1px 8px); }
.pz-band.on, .pz-over.on { opacity: 1; }
.pz-needle { position: absolute; top: -6px; bottom: -6px; width: 6px; margin-left: -3px; background: var(--red); z-index: 2; }
.pz-needle span { position: absolute; bottom: calc(100% + 3px); left: 50%; font-family: var(--f-mono); font-size: 13px; line-height: 1.4; background: var(--ink); color: var(--paper); padding: 0 6px; white-space: nowrap; }
.pz-scale.done .pz-needle { background: var(--ink); }
.pz-ticks { position: relative; height: 16px; margin-top: 4px; }
.pz-ticks span { position: absolute; top: 0; transform: translateX(-50%); font-family: var(--f-mono); font-size: 10px; color: var(--ink-2); white-space: nowrap; }
.pz-ticks span:first-child { transform: none; }
.pz-ticks span:last-child { transform: translateX(-100%); }
.pz-pat { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.pz-pat small { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--ink-2); }
.pz-pat span { flex: 1; height: 6px; border: 1.5px solid var(--ink); }
.pz-pat i { display: block; height: 100%; background: var(--ink); }

/* ---------- Kelime Avı ---------- */
.kl-slots { display: flex; justify-content: center; gap: 6px; margin: 8px 0 16px; min-height: 58px; color: var(--ink); transition: background-color .15s, color .15s; }
.kl-s { width: 42px; height: 54px; border: 0; border-bottom: 3px solid var(--ink-3); background: none; padding: 0; font-family: var(--f-display); font-weight: 400; font-size: 32px; line-height: 1; color: inherit; }
.kl-s.on { border-bottom-color: currentColor; animation: mgPress .16s ease-out; }
.kl-s.lock { color: var(--ink-2); border-bottom-style: dashed; }
.kl-s.reveal { display: grid; place-items: center; color: var(--ink-3); }
.kl-slots.win { background: var(--ink); color: var(--paper); }
.kl-slots.win .kl-s { border-bottom-color: var(--paper); animation: none; }
.kl-slots.bad { animation: shake .3s; }
.kl-slots.bad .kl-s { color: var(--red); border-bottom-color: var(--red); }
.kl-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 14px; }
.kl-t { width: 58px; height: 58px; border: var(--rule); background: var(--paper); padding: 0; font-family: var(--f-display); font-weight: 400; font-size: 30px; line-height: 1; color: var(--ink); transition: transform .08s; }
.kl-t:active { transform: translateY(2px); background: var(--paper-2); }
.kl-t.used { visibility: hidden; }
.kl-acts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.kl-acts .btn { flex-direction: row; gap: 6px; font-size: 12px; }

/* ---------- Yakala ---------- */
.yk { cursor: grab; touch-action: none; }
.yk::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: repeating-linear-gradient(45deg, var(--ink) 0 2px, transparent 2px 6px); pointer-events: none; }
.yk-it { position: absolute; left: 0; top: 0; width: 44px; height: 44px; border: 2.5px solid var(--ink); background: var(--paper); color: var(--ink); display: grid; place-items: center; will-change: transform; pointer-events: none; }
.yk-it .ic { width: 24px; height: 24px; }
.yk-it.bad { background: var(--red); border-color: var(--red); color: var(--paper); }
.yk-tray { position: absolute; left: 0; bottom: 12px; height: 26px; background: var(--ink); color: var(--paper); display: grid; place-items: center; will-change: transform; pointer-events: none; }
.yk-tray::before { content: ''; position: absolute; left: -6px; right: -6px; top: -6px; height: 4px; background: var(--ink); }
.yk-tray .ic { width: 18px; height: 18px; }
.yk-tray.bump { bottom: 8px; }
.yk-splat { position: absolute; bottom: 6px; width: 30px; height: 6px; margin-left: -15px; background: var(--ink-3); animation: mgFade .5s ease-in forwards; pointer-events: none; }
.yk-lives { display: inline-flex; gap: 4px; }
.yk-lives .ic { width: 17px; height: 17px; fill: var(--ink); stroke: var(--ink); vertical-align: -3px; transition: fill .2s, stroke .2s; }
.yk-lives .ic.lost { fill: none; stroke: var(--red); }

/* ---------- Sıralama ---------- */
.sr-q { font-family: var(--f-serif); font-size: 17px; line-height: 1.3; border-left: 6px solid var(--ink); background: var(--paper-2); padding: 8px 12px; margin-bottom: 10px; }
.sr-list { display: grid; gap: 6px; margin-bottom: 10px; }
.sr-it { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 50px; padding: 5px 10px 5px 5px; border: var(--rule); background: var(--paper); color: var(--ink); text-align: left; font-weight: 600; font-size: 14.5px; line-height: 1.25; transition: background-color .12s; }
.sr-n { flex: none; width: 38px; height: 38px; border: 2px dashed var(--ink-3); display: grid; place-items: center; font-family: var(--f-display); font-weight: 400; font-size: 24px; line-height: 1; }
.sr-it.on { background: var(--paper-2); }
.sr-it.on .sr-n { border: 0; background: var(--ink); color: var(--paper); }
.sr-n.pop { animation: mgPress .22s cubic-bezier(.2, .9, .3, 1.3); }
.sr-it.ok .sr-n { background: var(--ink); color: var(--paper); }
.sr-it.no { border-color: var(--red); }
.sr-it.no .sr-n { background: var(--red); color: var(--paper); }
.sr-it em { margin-left: auto; flex: none; font-style: normal; font-family: var(--f-mono); font-size: 12px; font-weight: 500; color: var(--red); border: 1.5px solid var(--red); padding: 1px 6px; white-space: nowrap; }

/* ---------- Short screens ---------- */
@media (max-height: 720px) {
  .mg { padding: 6px; }
  .mg-card { padding: 10px; }
  .mg-head { margin-bottom: 8px; padding-bottom: 6px; }
  .mg-msg { margin: 6px 0 2px; font-size: 19px; min-height: 26px; }
  .mg-big { padding: 14px; font-size: 26px; }
  .arena { height: min(50vh, 420px); }
  .mem { gap: 6px; }
  .mem-c, .mem.r4 .mem-c { aspect-ratio: 1.05; }
  .dz-copy b { font-size: 32px; }
  .dz-cell { aspect-ratio: 1.4; }
  .dz-t { width: auto; height: 80%; }
  .sr-it { min-height: 42px; font-size: 13.5px; }
  .sr-n { width: 32px; height: 32px; font-size: 20px; }
  .kl-t { width: 50px; height: 50px; }
  .pz-scale { margin-top: 28px; height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  .tgt { animation: none !important; }
  .mg-stamp, .mg-float { animation: none !important; }
  .dz-s.next { animation: none !important; }
  .mem-in { transition: none !important; }
}
