/* tamashebi.world — საჯარო საიტი. ერთი ფაილი, ფრეიმვორკის გარეშე (ბიუჯეტი ≤ 50 KB, SPEC §9). */
:root {
  --bg: #0f1115; --bg2: #151821; --panel: #1b1f2a; --line: #262b38;
  --text: #f2f2f5; --muted: #9aa0ac; --accent: #e8213b; --accent2: #ff3d55;
  --radius: 12px; --side: 232px; --top: 60px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Georgian", "FiraGO", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; z-index: 99; background: var(--accent); padding: 6px 10px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }
[hidden] { display: none !important; }

/* --- header --- */
.top { position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 14px;
  padding: 0 16px; background: rgba(15, 17, 21, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.logo img { height: 18px; width: auto; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); font-size: 18px; flex: none; }
.icon-btn:hover { border-color: #3a4152; }
.menu-btn { display: none; }
.search { position: relative; flex: 1; max-width: 560px; margin: 0 auto; }
.search input { width: 100%; height: 40px; padding: 0 14px 0 38px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239aa0ac' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5.5'/%3E%3Cpath d='M11 11l4 4'/%3E%3C/svg%3E") 12px 50% no-repeat;
  color: var(--text); font: inherit; font-size: 16px; }
.search input:focus { outline: none; border-color: var(--accent); }
.suggest { position: absolute; top: 46px; left: 0; right: 0; margin: 0; padding: 6px; list-style: none; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }
.suggest a { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 8px; }
.suggest a:hover, .suggest a.on { background: #262b38; }
.suggest img { width: 64px; height: 36px; object-fit: cover; border-radius: 6px; background: #000; }
.top-links { display: flex; gap: 8px; }

/* --- layout --- */
.layout { display: flex; }
.side { position: sticky; top: var(--top); height: calc(100vh - var(--top)); width: var(--side); flex: none; overflow-y: auto;
  padding: 12px 10px 24px; border-right: 1px solid var(--line); scrollbar-width: thin; }
.side hr { border: 0; border-top: 1px solid var(--line); margin: 10px 6px; }
.side-link { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; color: #d6d8de; font-size: 14px; }
.side-link span { width: 22px; text-align: center; }
.side-link:hover { background: var(--panel); }
.side-link.on { background: rgba(232, 33, 59, .14); color: #fff; }
.main { flex: 1; min-width: 0; padding: 18px 22px 40px; }

.h1 { font-size: 26px; line-height: 1.2; margin: 4px 0 16px; letter-spacing: -.01em; }
.h1 small { color: var(--muted); font-size: 16px; font-weight: 500; }
.h2 { font-size: 18px; margin: 22px 0 10px; }
.intro { color: #c9ccd4; max-width: 820px; margin: -6px 0 18px; }
.crumbs { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.crumbs a:hover { color: var(--text); }

.section { margin: 0 0 28px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 10px; }
.sec-head h2 { font-size: 19px; margin: 0; }
.sec-head a { color: var(--muted); font-size: 14px; } .sec-head a:hover { color: var(--text); }

/* --- cards --- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 220px); gap: 14px; overflow-x: auto;
  padding-bottom: 6px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.row .card { scroll-snap-align: start; }
.row[data-lazy-row]:empty { min-height: 160px; border-radius: var(--radius); background: linear-gradient(90deg, var(--panel), #20253200, var(--panel)); }
.card { display: block; }
.thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.thumb video { position: absolute; inset: 0; }
.card:hover .thumb img { transform: scale(1.04); }
.card:hover .thumb { box-shadow: 0 0 0 2px var(--accent); }
.card-title { display: block; margin-top: 7px; font-size: 14px; font-weight: 600; line-height: 1.3; color: #e9eaee;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.badge { position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 700;
  letter-spacing: .02em; text-transform: uppercase; }
.badge-new { background: var(--accent); color: #fff; }
.badge-top { background: #ffb000; color: #111; }
.badge-adult { left: auto; right: 8px; background: rgba(0, 0, 0, .7); color: #ff8a8a; border: 1px solid #ff8a8a55; }
.player-hints .badge-adult { position: static; }

.colls { grid-auto-columns: minmax(220px, 240px); }
.coll { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.coll img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.55); transition: transform .25s ease; }
.coll:hover img { transform: scale(1.05); } .coll:hover { box-shadow: 0 0 0 2px var(--accent); }
.coll span { position: absolute; inset: auto 0 0 0; padding: 10px 12px; background: linear-gradient(transparent, rgba(0,0,0,.85)); }
.coll b { display: block; font-size: 15px; } .coll em { font-style: normal; color: #cfd2d9; font-size: 12px; }
.grid[data-lazy-row]:empty { min-height: 160px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 99px; background: var(--panel);
  border: 1px solid var(--line); font-size: 14px; }
.chip em { font-style: normal; color: var(--muted); font-size: 12px; }
.chip:hover { border-color: var(--accent); }

.pager { display: flex; gap: 16px; justify-content: center; align-items: center; margin: 26px 0; color: var(--muted); }
.pager a { padding: 8px 14px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); color: var(--text); }
.js .pager.auto { display: none; }
.sentinel { height: 1px; }

.btn, .btn-play { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 12px; background: var(--accent);
  color: #fff; font-weight: 700; padding: 10px 18px; }
.btn:hover, .btn-play:hover { background: var(--accent2); }

/* --- game page --- */
.player-wrap { max-width: 1100px; }
.player { position: relative; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.player.portrait { aspect-ratio: auto; height: min(78vh, 760px); max-width: 520px; margin: 0 auto; }
.player-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(2px) brightness(.45); transform: scale(1.04); }
.player-start { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; text-align: center; padding: 16px; }
.player-icon { border-radius: 22px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.btn-play { font-size: 20px; padding: 14px 34px; border-radius: 14px; box-shadow: 0 10px 30px rgba(232, 33, 59, .35); }
.player-hints { margin: 0; color: #d0d3da; font-size: 13px; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.player-loading, .player-error { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px;
  background: rgba(0, 0, 0, .75); color: #ddd; }
.spinner { width: 34px; height: 34px; border: 3px solid #fff3; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.player-close { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 10px; z-index: 5; width: 40px; height: 40px;
  border-radius: 50%; border: 0; background: rgba(0, 0, 0, .65); font-size: 18px; }
.player.is-full { position: fixed; inset: 0; z-index: 100; border-radius: 0; aspect-ratio: auto; height: 100%; max-width: none; }
body.no-scroll { overflow: hidden; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 2px; }
.game-title { font-size: 22px; margin: 0; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; }
.tool { display: inline-flex; gap: 6px; align-items: center; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); font-size: 14px; }
.tool:hover { border-color: #3a4152; }
.tool[aria-pressed="true"] { color: var(--accent2); border-color: var(--accent); }
.game-info { max-width: 900px; }
.game-cats { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 6px; }
.prose { color: #d6d8de; }
.prose h3 { font-size: 15px; margin: 18px 0 6px; color: #fff; }
.prose ul { padding-left: 20px; }
.prose .q { font-weight: 600; margin: 12px 0 2px; color: #fff; }
.prose .a { margin: 0 0 8px; }
.lead { font-size: 17px; color: #e9eaee; margin: 6px 0 4px; }
.steps, .tips { padding-left: 22px; color: #d6d8de; } .steps li, .tips li { margin: 4px 0; }
.controls { border-collapse: collapse; width: 100%; max-width: 640px; }
.controls th, .controls td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.controls th { width: 160px; color: #fff; font-weight: 600; }
.faq details { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 8px 0; background: var(--panel); }
.faq summary { cursor: pointer; font-weight: 600; } .faq p { margin: 8px 0 0; color: #d6d8de; }
.tags { display: flex; flex-wrap: wrap; gap: 8px 12px; } .tags a { color: var(--muted); } .tags a:hover { color: var(--text); }
.seo-text { margin-top: 30px; color: #c9ccd4; max-width: 900px; } .seo-text summary { cursor: pointer; color: var(--muted); }
.empty { text-align: center; padding: 30px 0 10px; }

.langbar { position: sticky; top: 0; z-index: 31; display: flex; gap: 12px; align-items: center; justify-content: center;
  flex-wrap: wrap; padding: 8px 14px; background: #2a1016; border-bottom: 1px solid var(--accent); font-size: 14px; }
.langbar .btn { padding: 6px 14px; }
.langbar [data-no] { background: none; border: 0; color: var(--muted); text-decoration: underline; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 10px; }
.foot-links a { color: var(--muted); } .foot-links a:hover { color: var(--text); }
.page { max-width: 820px; } .page .prose h2 { font-size: 17px; margin: 22px 0 8px; color: #fff; }
.page .prose a { color: var(--accent2); text-decoration: underline; }
.foot-langs { display: flex; gap: 14px; margin: 0 0 8px; color: var(--muted); }
.foot-langs a { color: var(--muted); } .foot-langs a.on { color: var(--text); font-weight: 600; }

/* --- footer / tabbar --- */
.foot { border-top: 1px solid var(--line); padding: 22px; margin-left: var(--side); font-size: 13px; }
.foot-cats { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 10px; } .foot-cats a { color: var(--muted); } .foot-cats a:hover { color: var(--text); }
.tabbar { display: none; }

/* --- responsive --- */
@media (max-width: 1023px) {
  .menu-btn { display: grid; }
  .side { position: fixed; z-index: 40; top: var(--top); left: 0; background: var(--bg2); transform: translateX(-100%);
    transition: transform .2s ease; box-shadow: 10px 0 40px rgba(0, 0, 0, .5); }
  body.menu-open .side { transform: none; }
  .foot { margin-left: 0; }
}
@media (max-width: 700px) {
  .hide-mobile { display: none; }
  :root { --top: 56px; }
  .top { gap: 8px; padding: 0 10px; }
  .logo img { height: 14px; }
  .top-links { display: none; }
  .main { padding: 14px 12px calc(84px + env(safe-area-inset-bottom)); }
  .h1 { font-size: 21px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .row { grid-auto-columns: 46%; gap: 10px; }
  .card-title { font-size: 13px; }
  .tool span { display: none; }
  .game-title { font-size: 19px; width: 100%; }
  .player.portrait { height: 70vh; }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; z-index: 35; left: 0; right: 0; bottom: 0;
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); background: rgba(21, 24, 33, .97); border-top: 1px solid var(--line); }
  .tabbar a, .tabbar button { display: grid; justify-items: center; gap: 2px; font-size: 18px; background: none; border: 0; color: #cfd2d9; }
  .tabbar span { font-size: 11px; }
  .foot { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .search .suggest { position: fixed; top: var(--top); left: 8px; right: 8px; }
}
/* iOS ფოკუსზე ზუმი არ უნდა (filmebi-ს გაკვეთილი): ველები ≥ 16px */
input, select, textarea { font-size: 16px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
