/* ─── PixelGame — Latin display font ───────  */
@font-face {
  font-family: 'PixelGame';
  src: url('assets/fonts/PixelGame-R9AZe.otf') format('opentype');
  font-display: swap;
  font-weight: 400 900;
  font-style: normal;
}

/* ─── KAGONYAN OS — Poolsuite-90s desktop ── */
:root {
  --teal:        #1f8a8a;       /* darker desktop teal so window beige pops */
  --beige:       #e7e3d6;       /* slightly warmer paper */
  --beige-2:     #d8d3c3;
  --bevel-hi:    #ffffff;
  --bevel-lo:    #404040;
  --bevel-mid:   #808080;
  --black:       #000000;
  --ink:         #1a1a1a;
  --ink-dim:     #555555;

  /* Poolsuite accent palette — saturated 90s screen tones */
  --acc-blue:    #5bceeb;       /* profile */
  --acc-blue-2:  #2da7c8;
  --acc-peach:   #ff8b6b;       /* missions / orange */
  --acc-peach-2: #d65f3f;
  --acc-pink:    #ff6db1;       /* ulta / specials */
  --acc-pink-2:  #cf3f88;
  --acc-yellow:  #ffd84a;       /* skills / gold */
  --acc-yellow-2:#d4a90c;
  --acc-mint:    #6ee6a1;       /* confirm / select */
  --acc-mint-2:  #2fb56b;

  --red:         #ff5f57;
  --yellow:      #ffbd2e;
  --green:       #28ca42;

  --select-bg:   #0a3a8a;
  --select-fg:   #ffffff;
  --max:         500px;
}

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

html, body {
  font-family: 'Roboto Mono', monospace;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink);
  background: var(--teal);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  position: relative;
  padding-bottom: env(safe-area-inset-bottom);
  background-color: var(--teal);
}

img { image-rendering: pixelated; image-rendering: crisp-edges; max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; padding: 0; }
ul, ol { list-style: none; }

/* font-stack helper — Pixelify Sans on everything */
.font-display, .font-latin {
  font-family: 'Roboto Mono', monospace;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Global uppercase + bold on every UI header / badge / button text */
.tb-title, .namebar, .namebar-lvl, .info-title,
.mission-cat, .mission-name, .mission-badge, .label-bar,
.skill-name, .os-btn, .arsenal li, .menu-logo, .tb-start,
.roster-slot.locked .lock {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

/* ─── MENU BAR (top) ────────────────────── */
.menubar, .taskbar {
  position: sticky;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 12px 2px;
  background: var(--beige);
  border-bottom: 2px solid var(--bevel-lo);
  box-shadow: inset 0 1px 0 var(--bevel-hi);
  font-family: 'Roboto Mono', monospace;
  font-size: 20px;
  letter-spacing: 0.04em;
  color: var(--ink);
  line-height: 1.2;
}
.menubar { top: 0; }
.taskbar { bottom: 0; border-top: 2px solid var(--bevel-hi); border-bottom: none; }
.menu-clock { color: var(--ink-dim); }
.tb-start {
  display: inline-block;
  padding: 4px 12px;
  background: var(--beige-2);
  border: 1px solid var(--black);
  box-shadow: inset 1px 1px 0 var(--bevel-hi), inset -1px -1px 0 var(--bevel-lo);
}

/* ─── DESKTOP CONTAINER ─────────────────── */
.desktop {
  max-width: var(--max);
  margin: 0 auto;
  padding: 22px 16px 80px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Each section = a 3-column grid on wide screens; flex column with notes
   as banners above/below the window on mobile.                            */
.block {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 10px;
}
.block > .window { width: 100%; }

.note {
  display: block;
  padding: 8px 10px 4px;
  font-family: 'Caveat', cursive;
  font-weight: 700;
  font-size: 23px;
  line-height: 1.15;
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 0 rgba(0,0,0,0.55), 0 0 6px rgba(0,0,0,0.35);
  pointer-events: none;
  order: -1;  /* always above the window on mobile */
}
.note .note-text { display: block; margin-bottom: 4px; max-width: 360px; margin-left: auto; margin-right: auto; }
.note .note-arrow {
  display: block;
  width: 35px; height: auto;
  margin: 4px auto 0;
  transform: rotate(45deg);  /* mobile: point down (original arrow points down-left) */
  filter: drop-shadow(0 2px 0 rgba(0,0,0,0.45));
}
/* mobile both notes use the same down-pointing arrow */
.note-right .note-arrow { transform: rotate(45deg); }

/* ─── WINDOW SHELL ──────────────────────── */
.window {
  background: var(--beige);
  border: 1px solid var(--black);
  box-shadow:
    inset 1px 1px 0 var(--bevel-hi),
    inset -1px -1px 0 var(--bevel-lo),
    4px 4px 0 rgba(0,0,0,0.55);
}

/* ABOUT block has no title text — drop the plate entirely */
.window-about .tb-title { display: none; }
.window-about .titlebar { grid-template-columns: auto; }

/* TITLE BAR — accent fill, no grey stripes anymore */
.titlebar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--black);
  background: var(--acc-blue);
  position: relative;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.55),
    inset 0 -1px 0 rgba(0,0,0,0.35);
}
/* per-window accent variants */
.titlebar.tb-blue   { background: var(--acc-blue); }
.titlebar.tb-peach  { background: var(--acc-peach); }
.titlebar.tb-pink   { background: var(--acc-pink); }
.titlebar.tb-yellow { background: var(--acc-yellow); }
.titlebar.tb-mint   { background: var(--acc-mint); }

.tb-controls {
  display: inline-flex;
  gap: 5px;
  background: rgba(0,0,0,0.18);
  padding: 3px 6px;
  border: 1px solid var(--black);
  border-radius: 2px;
}
.tb-btn {
  width: 11px; height: 11px;
  border: 1px solid var(--black);
  display: inline-block;
}
.tb-red    { background: var(--red); }
.tb-yellow { background: var(--yellow); }
.tb-green  { background: var(--green); }

.tb-title {
  font-family: 'Roboto Mono', monospace;
  font-size: 22px;
  color: var(--ink);
  text-align: center;
  padding: 2px 10px 0;
  background: rgba(255,255,255,0.85);
  border: 1px solid var(--black);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), inset 0 -1px 0 rgba(0,0,0,0.25);
  line-height: 1.1;
  white-space: normal;
  overflow: visible;
  min-width: 0;
}

@media (max-width: 420px) {
  .tb-title { font-size: 18px; padding: 2px 8px 0; }
}

.content {
  padding: 16px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hr-os {
  border: none;
  border-top: 1px solid var(--bevel-lo);
  border-bottom: 1px solid var(--bevel-hi);
  margin: 4px 0;
}

/* ─── PROFILE WINDOW ────────────────────── */
.profile-portrait {
  display: flex;
  justify-content: center;
  margin: 4px 0 2px;
}
.profile-grid { display: none; }  /* legacy */
.profile-character {
  position: relative;
  width: 180px;
  aspect-ratio: 3 / 4;
  background: var(--acc-blue);
  border: 1px solid var(--black);
  box-shadow: inset 2px 2px 0 rgba(255,255,255,0.45), inset -2px -2px 0 rgba(0,0,0,0.35);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.profile-character::after {
  content: '';
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.06) 0 6px, transparent 6px 12px);
  pointer-events: none;
}
.character-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  transition: opacity 0.05s steps(1);
  z-index: 1;
}
.character-img.like { opacity: 0; }
.profile-character:hover .character-img.default { opacity: 0; }
.profile-character:hover .character-img.like    { opacity: 1; }

.namebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--select-bg);
  color: var(--select-fg);
  padding: 4px 12px 2px;
  font-family: 'Roboto Mono', monospace;
  font-size: 24px;
  border: 1px solid var(--black);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.4);
  line-height: 1.2;
  width: 100%;
  min-width: 0;
}
.namebar-name {
  flex: 1;
  min-width: 0;
}
.namebar-lvl {
  background: var(--acc-yellow);
  color: var(--black);
  padding: 1px 10px;
  border: 1px solid var(--black);
  font-family: 'Roboto Mono', monospace;
  font-size: 20px;
  line-height: 1.2;
  flex-shrink: 0;
}
.class-line {
  font-family: 'Roboto Mono', monospace;
  font-size: 20px;
  color: var(--ink);
  line-height: 1.3;
  width: 100%;
}

/* ─── ACCENT INFO BLOCKS (label-on-color, body white) ─── */
.info-block {
  display: flex; flex-direction: column;
  border: 1px solid var(--black);
  box-shadow: 2px 2px 0 rgba(0,0,0,0.35);
}
.info-title {
  font-family: 'Roboto Mono', monospace;
  font-size: 22px;
  color: var(--black);
  background: var(--acc-yellow);
  padding: 3px 10px 1px;
  border-bottom: 1px solid var(--black);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
  line-height: 1.2;
}
.info-block.accent-blue   .info-title { background: var(--acc-blue); }
.info-block.accent-peach  .info-title { background: var(--acc-peach); color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,0.35); }
.info-block.accent-pink   .info-title { background: var(--acc-pink);  color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,0.35); }
.info-block.accent-mint   .info-title { background: var(--acc-mint); }

.info-list {
  background: #fff;
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.info-list li {
  position: relative;
  padding-left: 16px;
  font-family: 'Roboto Mono', monospace;
  font-size: 15px;
  color: var(--ink);
  line-height: 1.4;
}
.info-list li::before {
  content: '—';
  position: absolute; left: 2px;
  color: var(--acc-peach-2);
}

/* ─── BUTTONS ────────────────────────────── */
.window-action { display: flex; justify-content: center; padding-top: 6px; }
.os-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 22px 4px;
  background: var(--beige-2);
  color: var(--ink);
  border: 1px solid var(--black);
  box-shadow:
    inset 1px 1px 0 var(--bevel-hi),
    inset -1px -1px 0 var(--bevel-lo),
    2px 2px 0 rgba(0,0,0,0.4);
  font-family: 'Roboto Mono', monospace;
  font-size: 22px;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 0.05s steps(1);
}

/* compact variant for "СВЕРНУТЬ" inside mission detail */
.os-btn.mission-close {
  display: inline-flex;
  font-size: 10px;
  padding: 3px 8px 2px;
  align-self: flex-start;
  box-shadow:
    inset 1px 1px 0 var(--bevel-hi),
    inset -1px -1px 0 var(--bevel-lo),
    1px 1px 0 rgba(0,0,0,0.3);
}
.os-btn:active { transform: translate(2px, 2px); box-shadow: inset 1px 1px 0 var(--bevel-lo), inset -1px -1px 0 var(--bevel-hi); }

.os-btn-primary {
  background: linear-gradient(180deg, #ff6b62 0%, #d63525 100%);
  color: #fff;
  text-shadow: 0 1px 0 rgba(0,0,0,0.45);
  border-color: #4a1108;
  box-shadow:
    inset 1px 1px 0 rgba(255,255,255,0.55),
    inset -1px -1px 0 rgba(0,0,0,0.35),
    2px 2px 0 rgba(0,0,0,0.5);
  animation: btnPulse 1.6s steps(2) infinite;
}
@keyframes btnPulse {
  0%, 100% { transform: translate(0,0); box-shadow: inset 1px 1px 0 rgba(255,255,255,0.55), inset -1px -1px 0 rgba(0,0,0,0.35), 2px 2px 0 rgba(0,0,0,0.5); }
  50%      { transform: translate(0,-1px); box-shadow: inset 1px 1px 0 rgba(255,255,255,0.55), inset -1px -1px 0 rgba(0,0,0,0.35), 3px 4px 0 rgba(0,0,0,0.5); }
}

.os-btn-select {
  position: relative;
  background: linear-gradient(180deg, #88f2b0 0%, #2fb56b 100%);
  color: #052e15;
  text-shadow: 0 1px 0 rgba(255,255,255,0.4);
  border-color: #052e15;
  padding: 12px 30px;
  font-size: 22px;
}

/* animated mouse cursor that "clicks" */
.cursor-anim {
  position: relative;
  display: inline-block;
  width: 24px; height: 28px;
  animation: cursorMove 2.4s ease-in-out infinite;
}
.cursor-anim svg { width: 100%; height: 100%; filter: drop-shadow(1px 1px 0 rgba(0,0,0,0.6)); display: block; }
.cursor-anim::after {
  content: '';
  position: absolute;
  left: 4px; top: 4px;
  width: 22px; height: 22px;
  border: 2px solid #fff;
  border-radius: 50%;
  opacity: 0;
  animation: cursorClick 2.4s ease-in-out infinite;
}
@keyframes cursorMove {
  0%, 60%, 100% { transform: translate(0, 0); }
  70%, 85% { transform: translate(-2px, -2px) scale(0.9); }
}
@keyframes cursorClick {
  0%, 65%, 100% { opacity: 0; transform: scale(0.5); }
  72% { opacity: 0.9; transform: scale(0.5); }
  88% { opacity: 0; transform: scale(1.6); }
}

/* ─── MISSIONS (Finder-style folder list) ─ */
.window-missions .content { gap: 10px; }
.mission {
  background: var(--beige-2);
  border: 1px solid var(--black);
  box-shadow: inset 1px 1px 0 var(--bevel-hi), inset -1px -1px 0 var(--bevel-lo);
}
.mission-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}
.mission-row:hover { background: var(--select-bg); color: var(--select-fg); }
.mission-row:hover .mission-cat,
.mission-row:hover .mission-name { color: var(--select-fg); }

.folder-icon {
  width: 56px; aspect-ratio: 1;
  background: var(--beige);
  border: 1px solid var(--black);
  box-shadow: inset 1px 1px 0 var(--bevel-hi), inset -1px -1px 0 var(--bevel-lo);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.folder-icon img { width: 100%; height: 100%; object-fit: cover; }

.mission-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mission-cat {
  font-family: 'Roboto Mono', monospace;
  font-size: 19px;
  letter-spacing: 0.08em;
  color: var(--acc-peach-2);
  line-height: 1.1;
}
.mission-name {
  font-family: 'Roboto Mono', monospace;
  font-size: 22px;
  color: var(--ink);
}

.mission-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px 0;
  font-family: 'Roboto Mono', monospace;
  font-size: 18px;
  letter-spacing: 0.1em;
  border: 1px solid var(--black);
  box-shadow: 1px 1px 0 rgba(0,0,0,0.4);
  line-height: 1.2;
}
.mode-medium { background: var(--acc-yellow); color: var(--black); }
.mode-hard   { background: var(--red);        color: var(--black); }

/* mission detail */
.mission-detail {
  padding: 12px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--beige);
  border-top: 1px solid var(--bevel-lo);
}
.mission-detail[hidden] { display: none !important; }

/* accent label bars (ЛОКАЦИЯ / РОЛЬ / БОСС / МИССИЯ / ТАКТИКА / ТРОФЕИ) */
.label-bar {
  display: inline-block;
  font-family: 'Roboto Mono', monospace;
  font-size: 19px;
  letter-spacing: 0.06em;
  color: #fff;
  background: var(--acc-peach-2);
  padding: 2px 10px 0;
  border: 1px solid var(--black);
  box-shadow: 1px 1px 0 rgba(0,0,0,0.4);
  text-shadow: 0 1px 0 rgba(0,0,0,0.4);
  margin-bottom: 6px;
  width: max-content;
  line-height: 1.2;
}
.label-bar.lb-blue  { background: var(--acc-blue-2); }
.label-bar.lb-pink  { background: var(--acc-pink-2); }
.label-bar.lb-mint  { background: var(--acc-mint-2); }
.label-bar.lb-yellow{ background: var(--acc-yellow-2); }

.m-row { display: flex; flex-direction: column; gap: 2px; padding: 4px 0; }
.m-row p,
.m-row .m-bullets {
  font-family: 'Roboto Mono', monospace;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: #fff;
  padding: 8px 12px;
  border: 1px solid var(--bevel-lo);
}
.m-bullets { display: flex; flex-direction: column; gap: 4px; }
.m-bullets li {
  position: relative; padding-left: 16px;
  font-family: 'Roboto Mono', monospace;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
}
.m-bullets li::before { content: '▸'; position: absolute; left: 2px; color: var(--acc-peach-2); }
.m-trophies li::before { color: var(--acc-yellow-2); }

/* ─── ABOUT block (hero hello) ──────────── */
.about-text {
  font-family: 'Roboto Mono', monospace;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.about-text b { font-weight: 700; }

/* ─── TOOLS block (formerly Arsenal) ────── */
.tools {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tools-title {
  font-family: 'Roboto Mono', monospace;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
}
.tools-line {
  font-family: 'Roboto Mono', monospace;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink);
}

/* ─── CV link under ВЫБРАТЬ (classic Win95 hyperlink) ─── */
.cv-link {
  font-family: 'Roboto Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: #0000EE;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
  margin-top: 4px;
  padding: 2px 4px;
}
.cv-link:hover { color: #2222ff; }
.cv-link:visited { color: #551A8B; }

/* ─── CONTENT STRIP (horizontal image inside a mission) ─ */
.content-strip {
  width: 100%;
  background: var(--black);
  border: 1px solid var(--black);
  box-shadow: inset 1px 1px 0 var(--bevel-lo), inset -1px -1px 0 var(--bevel-hi);
  overflow: hidden;
}
.content-strip img {
  width: 100%;
  height: auto;
  display: block;
}

/* ─── VIDEO ROW (3 mini 9:16 thumbs) ─ */
.video-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
}
.video-mini {
  position: relative;
  background: var(--black);
  border: 1px solid var(--black);
  box-shadow: 2px 2px 0 rgba(0,0,0,0.4);
  overflow: hidden;
  cursor: zoom-in;
  transition: transform 0.1s steps(1);
}
.video-mini:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 rgba(0,0,0,0.4); }
.video-mini video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.video-mini.ratio-9-16 { aspect-ratio: 9 / 16; }
.video-mini.ratio-3-4  { aspect-ratio: 3 / 4; }
.video-mini::after {
  content: '⛶';
  position: absolute;
  bottom: 4px; right: 6px;
  color: #fff;
  font-size: 14px;
  text-shadow: 0 1px 0 rgba(0,0,0,0.6), 0 0 4px rgba(0,0,0,0.6);
  pointer-events: none;
  z-index: 4;
}
.video-mini::before,
.works-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Ccircle cx='24' cy='24' r='20' fill='black' fill-opacity='0.55' stroke='white' stroke-width='2.5'/%3E%3Cpolygon points='20,15 20,33 35,24' fill='white'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 40px;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.works-item::before { background-size: 36px; }
@media (hover: hover) {
  .video-mini:hover::before,
  .works-item:hover::before { opacity: 0.85; }
}
@media (hover: none) {
  /* touch devices: subtle always-on play hint so users see it's tappable */
  .video-mini::before, .works-item::before { opacity: 0.55; }
}

/* ─── VIDEO FRAMES ──────────────────────── */
.video-frame {
  position: relative;
  margin: 0 auto;
  background: var(--black);
  border: 1px solid var(--black);
  box-shadow: inset 1px 1px 0 var(--bevel-lo), inset -1px -1px 0 var(--bevel-hi);
  overflow: hidden;
}
.video-frame::before {
  content: attr(data-placeholder);
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 12px;
  color: var(--beige);
  font-family: 'Roboto Mono', monospace;
  font-size: 20px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--ink);
}
.video-frame video { width: 100%; height: 100%; display: block; object-fit: cover; position: relative; z-index: 2; }
.video-frame.ratio-9-16 { aspect-ratio: 9 / 16; max-width: 240px; }
.video-frame.ratio-16-9 { aspect-ratio: 16 / 9; width: 100%; }

/* iframe-based embeds (VK / Rutube / YouTube) */
.video-frame.video-embed { cursor: default; }
.video-frame.video-embed::before { display: none; }
.video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  position: relative;
  z-index: 2;
}
.speaking-caption {
  font-family: 'Roboto Mono', monospace;
  font-size: 15px;
  line-height: 1.4;
  color: var(--ink);
  text-align: center;
  padding: 4px 8px;
}
.speaking-caption b { font-weight: 700; }

/* ─── WORKS CAROUSEL ──────────────────── */
.content-tight { padding: 14px 0 16px; }
.content-tight > * { padding-left: 14px; padding-right: 14px; }
.content-tight > .works-carousel { padding-left: 0; padding-right: 0; }

.works-carousel {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--bevel-mid) transparent;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: auto;
}
.works-carousel::-webkit-scrollbar { height: 6px; }
.works-carousel::-webkit-scrollbar-thumb { background: var(--bevel-mid); }
.works-carousel::-webkit-scrollbar-track { background: transparent; }

.works-track {
  display: flex;
  gap: 8px;
  padding: 4px 25%;  /* margins so first/last sit half-visible on edges */
}
.works-item {
  flex: 0 0 calc(25% - 6px);
  background: var(--black);
  border: 1px solid var(--black);
  box-shadow: 2px 2px 0 rgba(0,0,0,0.4);
  overflow: hidden;
  cursor: zoom-in;
  transition: transform 0.1s steps(1);
  position: relative;
}
.works-item.ratio-9-16 { aspect-ratio: 9 / 16; }
.works-item:hover { transform: translate(-1px, -1px); }
.works-item video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }

@media (max-width: 600px) {
  .works-track { padding: 4px 20%; }
  .works-item { flex: 0 0 calc(60% - 6px); }
}

/* sticky 'листай вбок' note (extension of .note) */
.swipe-finger {
  display: inline-block;
  font-size: 34px;
  line-height: 1;
  margin: 6px 0 0;
  animation: swipeFinger 1.6s ease-in-out infinite;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,0.4));
  transform-origin: 50% 75%;
}
@keyframes swipeFinger {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  25%      { transform: translateX(-16px) rotate(-18deg); }
  75%      { transform: translateX(16px)  rotate(18deg); }
}

/* ─── REVIEWS / GUILD GRID ──────────────── */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.review-thumb {
  position: relative;
  background: var(--beige-2);
  border: 1px solid var(--black);
  box-shadow: 2px 2px 0 rgba(0,0,0,0.4);
  overflow: hidden;
  cursor: zoom-in;
  transition: transform 0.1s steps(1);
}
.review-thumb.ratio-3-4 { aspect-ratio: 3 / 4; }
.review-thumb:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 rgba(0,0,0,0.4); }
.review-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.review-thumb::after {
  content: '⛶';
  position: absolute;
  bottom: 4px; right: 6px;
  color: #fff;
  font-size: 16px;
  text-shadow: 0 1px 0 rgba(0,0,0,0.6), 0 0 4px rgba(0,0,0,0.6);
}
.review-thumb.review-empty {
  background: repeating-linear-gradient(45deg, var(--beige-2) 0 8px, var(--beige) 8px 16px);
  cursor: default;
}
.review-thumb.review-empty::before {
  content: 'review slot';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-dim); font-size: 14px; font-weight: 500;
  letter-spacing: 0.05em;
}
.review-thumb.review-empty img { display: none; }
.review-thumb.review-empty::after { display: none; }

/* ─── LIGHTBOX OVERLAY ──────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(7, 16, 36, 0.92);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}
.lightbox.is-open { display: flex; }
.lightbox-content {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-content > * {
  max-width: 100%;
  max-height: 90vh;
  background: var(--black);
  border: 2px solid var(--black);
  box-shadow: 0 8px 0 rgba(0,0,0,0.55), 0 0 32px rgba(76,201,240,0.18);
  display: block;
}
.lightbox-content video { width: auto; height: auto; }
.lightbox-content img { width: auto; height: auto; }
.lightbox-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 44px; height: 44px;
  background: var(--beige);
  border: 2px solid var(--black);
  box-shadow: inset 1px 1px 0 var(--bevel-hi), inset -1px -1px 0 var(--bevel-lo), 2px 2px 0 rgba(0,0,0,0.5);
  font-family: 'Roboto Mono', monospace;
  font-weight: 700;
  font-size: 20px;
  color: var(--ink);
  cursor: pointer;
  z-index: 201;
}

/* ─── ULTA / SPECIAL ABILITIES ──────────── */
.ulta-sub {
  text-align: center;
  color: var(--ink-dim);
  font-family: 'Roboto Mono', monospace;
  font-size: 18px;
  margin-top: -6px;
}
.ulta-scene {
  background: var(--beige);
  border: 1px solid var(--black);
  box-shadow: inset 1px 1px 0 var(--bevel-hi), inset -1px -1px 0 var(--bevel-lo);
  padding: 6px;
  position: relative;
}
.ulta-scene img { width: 100%; display: block; }

.arsenal { display: flex; flex-wrap: wrap; gap: 6px; }
.arsenal-pad { padding: 10px 12px; background: #fff; }
.arsenal li {
  font-family: 'Roboto Mono', monospace;
  font-size: 20px;
  padding: 2px 10px 0;
  background: var(--acc-yellow);
  color: var(--black);
  border: 1px solid var(--black);
  box-shadow: 1px 1px 0 rgba(0,0,0,0.4);
  line-height: 1.2;
}

.ulta-demos { display: flex; flex-direction: column; gap: 10px; }

/* ─── SKILLS (Unlocked) ─────────────────── */
.skill-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.skill {
  background: #fff;
  border: 1px solid var(--black);
  box-shadow: 2px 2px 0 rgba(0,0,0,0.4);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  transition: background 0.1s steps(1);
}
.skill:hover { background: var(--acc-yellow); }
.skill-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.skill-icon {
  width: 38px; height: 38px;
  background: var(--beige-2);
  border: 1px solid var(--black);
  box-shadow: inset 1px 1px 0 var(--bevel-hi), inset -1px -1px 0 var(--bevel-lo);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.skill-icon img { width: 100%; height: 100%; object-fit: contain; }
.skill-name {
  font-family: 'Roboto Mono', monospace;
  font-size: 19px;
  color: var(--ink);
  line-height: 1.1;
  flex: 1; min-width: 0;
}
.skill-desc {
  font-family: 'Roboto Mono', monospace;
  font-size: 19px;
  color: var(--ink-dim);
  line-height: 1.3;
}

@media (min-width: 560px) {
  .skill-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─── ROSTER / CONFIRM CHOICE ────────────── */
.roster-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  align-items: end;
  margin-bottom: 16px;
}
.roster-slot {
  aspect-ratio: 3 / 4;
  background: var(--beige-2);
  border: 1px solid var(--black);
  box-shadow: inset 1px 1px 0 var(--bevel-hi), inset -1px -1px 0 var(--bevel-lo);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
}
.roster-slot.locked {
  background: var(--ink);
  border-color: var(--black);
}
.roster-slot.locked::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,0.05) 0 4px, transparent 4px 8px);
}
.roster-slot.locked .lock {
  font-family: 'Roboto Mono', monospace;
  font-size: 32px;
  color: var(--beige);
  z-index: 2;
  line-height: 1;
}
.roster-slot.main {
  background: var(--acc-mint);
  transform: scale(1.06);
  z-index: 2;
  cursor: pointer;
}
.roster-slot.main .roster-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  transition: opacity 0.05s steps(1);
}
.roster-slot.main .roster-img.light { opacity: 0; }
.roster-slot.main:hover .roster-img.default { opacity: 0; }
.roster-slot.main:hover .roster-img.light   { opacity: 1; }

.select-action { display: flex; flex-direction: column; align-items: center; gap: 12px; }

/* ─── RESPONSIVE ────────────────────────── */
@media (min-width: 720px) {
  .desktop { padding: 32px 18px 100px; gap: 36px; }
  .profile-grid { grid-template-columns: 170px minmax(0, 1fr); }
  .profile-character { width: 170px; }
  .video-frame.ratio-9-16 { max-width: 280px; }
  .namebar { font-size: 22px; }
  .namebar-lvl { font-size: 20px; }
}

/* Notes flank windows on wide screens (>= 1024px); sticky to follow scroll */
@media (min-width: 1024px) {
  .desktop {
    max-width: 1120px;
    padding: 40px 24px 120px;
    gap: 48px;
  }
  .block {
    display: grid;
    grid-template-columns: 240px 500px 240px;
    gap: 24px;
    justify-content: center;
    align-items: start;
  }
  .block > .window { grid-column: 2; max-width: 500px; width: 500px; }

  .note {
    position: sticky;
    top: 88px;
    align-self: start;
    order: 0;
    font-size: 28px;
    padding: 12px 6px;
  }
  .note .note-text { max-width: none; }
  .note .note-arrow { width: 65px; height: auto; margin: 8px 0 0; }

  .note-left  {
    grid-column: 1;
    text-align: right;
    padding-right: 8px;
    transform: rotate(-3deg);
  }
  .note-right {
    grid-column: 3;
    text-align: left;
    padding-left: 8px;
    transform: rotate(2deg);
  }
  /* arrow always points DOWN (rotate 45deg from original down-left orientation) */
  .note-left  .note-arrow { transform: rotate(45deg); margin-left: auto;  margin-right: 0; }
  .note-right .note-arrow { transform: rotate(45deg); margin-left: 0;     margin-right: auto; }
}
