/* ==========================================================================
   2. GLOBAL RESET & BASE STYLES
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  background-color: var(--desk-wood);
}

body.magazine-desk-body {
  font-family: var(--font-serif);
  color: var(--ink-charcoal);
  background-color: var(--desk-wood);
  /* Genuine tactile desk paper texture */
  background-image: var(--paper-grain-img);
  background-repeat: repeat;
  background-size: 512px 512px;
  background-blend-mode: multiply;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Crisp pixel rendering for real 240x320 LCD screenshots */
img.screen-pixel-img,
canvas.k800i-pixel-canvas,
.card-screen-wrap img,
.art-print-icon,
.spread-screen-wrap img {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

/* Clean print scrollbars */
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
::-webkit-scrollbar-track {
  background: var(--paper-cream);
  border-left: 1px solid var(--ink-black);
}
::-webkit-scrollbar-thumb {
  background: var(--ink-black);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--ink-red);
}

/* Universal display hidden utility */
.hidden {
  display: none !important;
}

/* Accessible keyboard focus ring (WCAG 2.1 AA) */
:focus-visible {
  outline: 3px solid var(--ink-red);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--ink-red);
  outline-offset: 2px;
}

/* Respect OS reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High-contrast WASM badge on paper */
.compat-badge-wasm {
  color: #0e6f3d;
  font-weight: 700;
}

/* Graceful 3D WebGL fallback panel */
.phone3d-webgl-fallback {
  width: 100%;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  text-align: center;
  background: #14161a;
  color: #f4f0e8;
  border: 2px solid var(--ink-black);
  box-shadow: var(--shadow-print-sm);
  font-family: var(--font-serif);
  font-size: 0.85rem;
}

.webgl-fallback-badge {
  background: var(--ink-yellow);
  color: var(--ink-black);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.8rem;
  padding: 3px 10px;
  border: 1.5px solid var(--ink-black);
}

/* Magazine coupon cut line */
.mag-coupon-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--ink-secondary);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.mag-coupon-line::after {
  content: '';
  flex: 1;
  border-bottom: 2px dashed #B8B2A6;
}

/* --------------------------------------------------------------------------
   3. RUNNING HEADER (КОЛОНТИТУЛ ЖУРНАЛА СВЕРХУ)
   -------------------------------------------------------------------------- */
.mag-running-header {
  background: var(--ink-black);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  padding: 6px 0;
  border-bottom: 2px solid var(--ink-red);
}

.mag-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.mag-run-issue {
  color: var(--ink-yellow);
  font-weight: 700;
}

.mag-run-page {
  background: var(--ink-red);
  padding: 1px 8px;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   4. MASTHEAD (ТИТУЛЬНЫЙ БЛОК ЖУРНАЛА «СТРАНА ИГР»)
   -------------------------------------------------------------------------- */
