/* Bazar Blot "card room" look (Artk's choice, 2026-12-01).
   Menus and lists = squared notebook paper (like the sheet people keep the Blot score on).
   The game table = card table cloth. No yellow; the main button is ink on paper or light on the cloth.
   Teams, turn and states are shown by shape, underline and words, never by colour alone.
   Loaded after app.css: it only maps the old colour names onto these tokens and restyles a few parts. */

/* ---------- tokens: paper (light is the default, dark below) ---------- */
.app, .overlay .card, .drawer, .tipbox, .table-view .bidpanel, .table-view .combobar, .table-view .lastpanel, .table-view .sheetpanel {
  --paper: #FCFCF8; --paper2: #F2F3EE; --grid: #E3E9F0; --ink: #1A1E23; --pencil: #56616D; --rule: #CDD5DE; --pen: #1F3F8F;
  --bg: var(--paper2); --bg2: var(--paper2); --surface: var(--paper); --surface2: var(--rule); --muted: var(--pencil);
  --page: var(--paper); --page2: var(--paper2); --panel: var(--paper); --raised: var(--paper2); --sunk: var(--paper2);
  --line: var(--rule); --line-strong: #7D8894; --dim: var(--pencil); --faint: var(--pencil); --link: var(--pen);
  --yellow: var(--ink); --outline: var(--paper); --pri-bg: var(--ink); --pri-ink: var(--paper);
  --sel-bg: var(--ink); --sel-ink: var(--paper); --accent-text: var(--pen); --blue: var(--pen);
  --shadow: none; --shadow-pop: 0 18px 44px -12px rgba(20,24,28,.35);
  color: var(--ink);
}
:root[data-theme="dark"] .app, :root[data-theme="dark"] .overlay .card, :root[data-theme="dark"] .drawer, :root[data-theme="dark"] .tipbox {
  --paper: #1B2025; --paper2: #232930; --grid: #252B32; --ink: #ECEEF0; --pencil: #A7B1BC; --rule: #3A424B; --pen: #A9C0FF; --line-strong: #6C7783;
  --shadow-pop: 0 18px 44px -12px rgba(0,0,0,.7);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .app, :root:not([data-theme="light"]) .overlay .card, :root:not([data-theme="light"]) .drawer, :root:not([data-theme="light"]) .tipbox {
    --paper: #1B2025; --paper2: #232930; --grid: #252B32; --ink: #ECEEF0; --pencil: #A7B1BC; --rule: #3A424B; --pen: #A9C0FF; --line-strong: #6C7783;
    --shadow-pop: 0 18px 44px -12px rgba(0,0,0,.7);
  }
}
/* the tip bubble is ink on paper turned around */
.tipbox { background: var(--ink); color: var(--paper); }

/* ---------- cloth colours (Settings > Table: green is the default) ---------- */
:root { --cloth-a: #22654A; --cloth-b: #123D2D; --cloth-ink: #F3F1E8; --cloth-dim: #B4CDBF; --cloth-dark: #0E3125; }
:root[data-felt="navy"] { --cloth-a: #24406A; --cloth-b: #13243F; --cloth-dim: #B7C4D8; --cloth-dark: #0E1C33; }
:root[data-felt="graphite"] { --cloth-a: #3A3F46; --cloth-b: #1E2125; --cloth-dim: #BCC1C8; --cloth-dark: #17191C; }
:root[data-felt="wood"] { --cloth-a: #6A4730; --cloth-b: #38251A; --cloth-dim: #D9C3B0; --cloth-dark: #2A1B12; }
.card.cloth, .app.in-table {
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(255,255,255,.10), transparent 62%),
    repeating-linear-gradient(45deg, rgba(0,0,0,.035) 0 2px, transparent 2px 4px),
    linear-gradient(var(--cloth-a), var(--cloth-b));
}
/* text and controls on the cloth */
.cloth, .app.in-table .top, .table-view {
  --ink: var(--cloth-ink); --muted: var(--cloth-dim); --dim: var(--cloth-dim); --faint: var(--cloth-dim);
  --bg: rgba(0,0,0,.22); --bg2: rgba(0,0,0,.18); --surface: rgba(0,0,0,.20); --surface2: rgba(255,255,255,.22);
  --panel: rgba(0,0,0,.20); --raised: rgba(0,0,0,.30); --sunk: rgba(0,0,0,.28); --line: rgba(255,255,255,.22); --line-strong: rgba(243,241,232,.6);
  --yellow: var(--cloth-ink); --outline: var(--cloth-dark); --pri-bg: var(--cloth-ink); --pri-ink: var(--cloth-dark);
  --sel-bg: var(--cloth-ink); --sel-ink: var(--cloth-dark); --accent-text: var(--cloth-ink); --blue: #FFFFFF; --link: var(--cloth-ink);
  --felt: transparent; --felt-desk: transparent;
  color: var(--cloth-ink);
}

/* ---------- type: narrow strong headings, plain text ---------- */
.app { --font: Barlow, "Noto Sans Armenian", system-ui, sans-serif; --head: "Barlow Condensed", "Noto Sans Armenian", "Arial Narrow", sans-serif; --hand: Caveat, "Comic Sans MS", cursive; }
.card h1, .card h2, .ldh, .rules h3, .drawer-head b, .ob-h b { font-family: var(--head); font-stretch: 75%; font-weight: 700; text-transform: uppercase; letter-spacing: .015em; line-height: 1; }
.card h1 { font-size: 46px; }
.card h2 { font-size: 24px; }
:lang(hy) .card h1 { font-size: 38px; } :lang(hy) .card h2 { font-size: 21px; } :lang(ru) .card h1 { font-size: 40px; }

/* ---------- page: squared paper ---------- */
html, body { background: var(--page2, #F2F3EE); }
.app:not(.in-table) {
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 20px 20px; background-position: -1px -1px;
}

/* top bar: plain text buttons, no pills */
.top .pill, .top .round { background: transparent; border: 0; box-shadow: none; }
.top .pill { padding: 10px 8px; font-weight: 600; }
.langsw { background: transparent; padding: 0; }
.langsw button { padding: 9px 7px; font-weight: 600; opacity: .72; letter-spacing: .03em; }
.langsw button.on { background: transparent; color: var(--ink); opacity: 1; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.th-btn { background: transparent; border: 0; }

/* ---------- boxes: flat sections on paper, separated by a pen line ---------- */
.card { background: transparent; border: 0; box-shadow: none; border-radius: 0; padding: 4px 2px; }
.view > .card:not(.hero):not(.install):not(.ban):not(.resume):not(.cardnote), .lgrid .card:not(.hero) { padding-top: 14px; border-top: 2px solid var(--ink); }
.overlay .card { background: var(--paper); border: 1px solid var(--rule); border-radius: 14px; padding: 20px 18px; box-shadow: var(--shadow-pop); }
.overlay { background: rgba(14,18,22,.55); }
@supports ((backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px))) { .overlay { background: rgba(14,18,22,.4); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); } }
.install, .ban, .resume, .cardnote { border: 1.5px solid var(--ink); border-radius: 12px; padding: 12px 14px; background: var(--paper); }
.install { border-style: dashed; }

/* buttons */
.btn { border-radius: 12px; font-weight: 700; box-shadow: none; }
.btn.alt { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn:disabled { opacity: .45; }
.seg { background: transparent; border: 1.5px solid var(--line-strong); border-radius: 12px; padding: 2px; }
.seg button { color: var(--ink); font-weight: 600; opacity: .8; }
.seg button.on { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
input { background: var(--paper); border: 1.5px solid var(--line-strong); }
.tip { border-width: 1.5px; }
.linkbtn { color: var(--ink); font-weight: 600; text-decoration-color: var(--line-strong); }

/* ---------- lobby ---------- */
.lgrid { gap: 22px; }
.lobby .lgrid > .hero { order: 1; } .lobby .pulse { order: 2; } .lobby #pubCard { order: 3; } .lobby #recentCard { order: 4; } .lobby #loginCard { order: 5; }
.lobby #topCard { display: none; }
/* the hero: the one object on the page, a piece of card table */
.lobby .hero.cloth { border-radius: 18px; padding: 22px 18px 18px; gap: 10px; box-shadow: 0 14px 30px -16px rgba(0,0,0,.55); overflow: hidden; }
.hero #tSub { color: var(--cloth-dim); font-size: 15px; }
.fan5 { position: relative; height: 128px; margin: 6px 0 4px; pointer-events: none; }
.fan5 img { position: absolute; left: 50%; bottom: 0; width: 70px; aspect-ratio: 167 / 243; transform-origin: 50% 125%; border-radius: 6px; box-shadow: 0 6px 14px -5px rgba(0,0,0,.5); }
.fan5 img:nth-child(1) { transform: translateX(-50%) translateX(-72px) rotate(-20deg); }
.fan5 img:nth-child(2) { transform: translateX(-50%) translateX(-36px) rotate(-10deg); }
.fan5 img:nth-child(3) { transform: translateX(-50%); }
.fan5 img:nth-child(4) { transform: translateX(-50%) translateX(36px) rotate(10deg); }
.fan5 img:nth-child(5) { transform: translateX(-50%) translateX(72px) rotate(20deg); }
.hero .stack { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(0,1fr); gap: 10px; }
.hero .stack .onlinebox { grid-column: 1 / -1; }
.hero .btn { min-height: 52px; font-size: 17px; }
.hero .btn.alt { border-color: rgba(243,241,232,.6); }
.hero .target-row { font-weight: 600; font-size: 15px; color: var(--cloth-dim); }
.hero .seg { border-color: rgba(243,241,232,.4); }
.hero .seg button { min-height: 40px; padding: 8px 12px; }
.hero .linkbtn { color: var(--cloth-ink); text-decoration-color: rgba(243,241,232,.5); padding: 6px 0; min-height: 36px; }
.hero .onlinebox { background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.2); }
.hero .join input { background: rgba(0,0,0,.25); border-color: rgba(243,241,232,.5); color: var(--cloth-ink); }
.hero .join input::placeholder { color: var(--cloth-dim); }

/* live line instead of four number boxes */
.pulse { display: block; font-size: 15px; color: var(--muted); padding: 0 2px; }
.pulse b { color: var(--ink); }

/* open tables: lighter, the little round table stays (it is where you pick a seat) */
#pubT .cnt { background: transparent; border: 1.5px solid var(--ink); border-radius: 999px; font-family: var(--font); font-stretch: 100%; font-size: 14px; }
.rtab { background: transparent; border-radius: 0; padding: 10px 0 14px; border-bottom: 1px solid var(--rule); }
.rtab .rcnt { background: transparent; border: 1.5px solid var(--ink); }
.ttype { border-width: 1.5px; }
.rt .disc { fill: var(--cloth-a); stroke: var(--cloth-b); }
.rt .mid { background: var(--cloth-b); color: var(--cloth-ink); }
.rt .mid b { color: var(--cloth-ink); }
.rt .tm1, .rt .tm2 { stroke: var(--cloth-ink); }
.rt .dl { background: var(--ink); color: var(--paper); }
.rt .plus.ask { border-color: var(--ink); color: var(--ink); border-style: dotted; }

/* last games: lines on the sheet, the score written by hand */
.recent { gap: 0; border-top: 1px solid var(--rule); }
.recent li { position: relative; display: block; background: transparent; border-radius: 0; padding: 10px 96px 10px 0; border-bottom: 1px solid var(--rule); line-height: 1.4; }
.recent li:nth-child(n+4) { display: none; }
.recent .rs { position: absolute; right: 0; top: 50%; transform: translateY(-50%); margin: 0; opacity: 1; text-align: right; font-size: 12px; color: var(--muted); }
.recent .rs b { display: block; font: 700 26px/1 var(--hand); color: var(--pen); }

/* me: one quiet block at the end, links instead of tiles */
#loginCard { gap: 12px; }
.who { font-size: 17px; font-weight: 700; }
.chipline { font-size: 17px; }
.navrow { display: flex; flex-wrap: wrap; gap: 2px 18px; padding-top: 6px; }
.navb { background: transparent; border-radius: 0; padding: 8px 0; min-height: 44px; font-weight: 600; gap: 6px; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line-strong); }
.navb:hover { background: transparent; text-decoration-color: var(--ink); }
.navb svg { width: 18px; height: 18px; color: var(--ink); }
.toplist li { background: transparent; border-radius: 0; border-bottom: 1px solid var(--rule); padding: 8px 0; }
.toplist li:nth-child(-n+3) .tr { color: var(--ink); text-decoration: underline; }
.faq { margin-top: 10px; }

/* desktop: hero left, me right, then tables and last games */
@media (min-width:1000px) {
  .lgrid { grid-template-areas: "hero me" "pulse pulse" "main side"; }
  .lobby .hero.cloth { padding: 28px 26px 22px; }
  .fan5 { height: 150px; } .fan5 img { width: 82px; }
}

/* ---------- other screens (leaders, profile, settings, waiting room, stats) ---------- */
.ldbox { background: transparent; border-radius: 0; }
.tabs3 button, .opt, .tog { background: transparent; border: 1.5px solid var(--line-strong); }
.tabs3 button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.opt.on { border-color: var(--ink); border-width: 2.5px; }
.seatrow { background: transparent; border-bottom: 1px solid var(--rule); border-radius: 0; padding: 10px 0; }
.stat-grid div { background: transparent; border: 1px solid var(--rule); }
.stat-grid b, .bigno, .rows b { color: var(--ink); }

/* ---------- the table ---------- */
.app.in-table .top { color: var(--cloth-ink); }
.board { background: transparent !important; }
.chip { background: rgba(0,0,0,.22); }
.chip.score b, .msgline { color: var(--cloth-ink); }
.seat { background: rgba(0,0,0,.20); border-radius: 12px; }
.seat.turn { background: rgba(0,0,0,.34); border-color: var(--cloth-ink); }
.seat.turn .turntxt { color: var(--cloth-ink); text-decoration: underline; text-underline-offset: 3px; }
.seat .bub { background: var(--cloth-ink); color: var(--cloth-dark); }
.seat .dealer { background: var(--cloth-ink); color: var(--cloth-dark); }
.trick .empty { color: var(--cloth-dim); }
.hcard.sel::after { background: var(--cloth-ink); color: var(--cloth-dark); }
#chatDot { background: var(--cloth-ink); }
/* the bid sheet, combination bar, last trick and score sheet: paper slips on the cloth */
.table-view .bidpanel, .table-view .combobar, .table-view .lastpanel, .table-view .sheetpanel { background: var(--paper); color: var(--ink); border: 1px solid var(--rule); box-shadow: 0 10px 26px -10px rgba(0,0,0,.6); }
.table-view .bidpanel button { background: var(--paper); border: 1.5px solid var(--line-strong); color: var(--ink); }
.table-view .bidpanel button.on, .table-view .bidpanel .acts button.go { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.table-view .bidpanel .acts button.go:disabled { background: transparent; color: var(--pencil); border: 2px dashed var(--line-strong); }
.table-view .bidpanel .sd { background: var(--paper2); border-color: var(--rule); }
.table-view .bidpanel .sd.new { border-color: var(--ink); }
.table-view .combobar .btn.cta { background: var(--cloth-ink); color: var(--cloth-dark); }
.table-view .sheetpanel b, .table-view .lastpanel b { color: var(--ink); }
.cbub.hi { background: var(--cloth-ink); color: var(--cloth-dark); border-color: var(--cloth-ink); }
.mytimer .mt-bar { background: rgba(0,0,0,.3); border-color: rgba(255,255,255,.25); }
.mytimer .mt-bar i { background: var(--cloth-ink); }

/* chat: a paper sheet */
.drawer { background: var(--paper); }
.msg { background: var(--paper2); } .msg.me { background: transparent; border: 1px solid var(--rule); }
.msg b { color: var(--ink); }
.quick button { background: transparent; border: 1.5px solid var(--line-strong); }

@media (prefers-reduced-motion: no-preference) { .btn, .navb { transition: transform .12s; } .btn:active { transform: scale(.97); } }

/* table info line: plain text on the cloth; the score is a paper slip with handwritten numbers */
.table-view .chip { background: transparent; padding: 4px 2px; }
.table-view .chip.lastchip { border: 1.5px solid var(--line-strong); padding: 6px 10px; }
.table-view .chip.score { background: #FCFCF8; color: #1A1E23; border-radius: 4px; padding: 5px 10px; transform: rotate(-.6deg); box-shadow: 0 4px 10px -4px rgba(0,0,0,.5); }
.table-view .chip.score b { color: #1F3F8F; font: 700 21px/1 var(--hand); }
.table-view .chip.score .muted { color: #56616D; }
.seat .ring .rp { stroke: var(--cloth-ink); }
.seat .ring .rt { stroke: rgba(255,255,255,.16); }
/* Armenian: no capitals in headings (reads more naturally) */
:lang(hy) .card h1, :lang(hy) .card h2, :lang(hy) .ldh, :lang(hy) .rules h3 { text-transform: none; letter-spacing: 0; }
/* hero buttons: side by side when they fit, else one under the other */
.hero .stack { display: flex; flex-wrap: wrap; }
.hero .stack .btn { flex: 1 1 auto; white-space: nowrap; padding: 12px 16px; }
.hero .stack .onlinebox { flex: 1 1 100%; }
/* open tables: smaller round table, light join button */
.rt { max-width: 250px; }
.rtab .rfoot, .rtab > .btn { align-self: center; }
.rtab > .btn { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); min-height: 44px; font-size: 15px; padding: 8px 18px; }
.rtabs { gap: 0; }
.table-view .bidpanel { border-radius: 14px; }
/* the new fonts must be set on .app itself (body reads --font from :root) */
.app { font-family: var(--font); }
/* small card index: the suit sign from a font that draws it clearly */
.pc.rc .ri i { font-family: Arial, "Segoe UI Symbol", "Apple Symbols", sans-serif; font-weight: 400; font-size: 30cqw; line-height: 1; }
