/* ============================================================
   doshka — hybrid 8-bit theme
   Pixel font for chrome/headings/buttons; readable font for body.
   ============================================================ */

/* ---- Press Start 2P (vendored, Latin + Cyrillic for Ukrainian) ---- */
@font-face {
    font-family: 'Press Start 2P';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/PressStart2P-cyrillic-ext-3xhhmN5.woff2") format('woff2');
    unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
    font-family: 'Press Start 2P';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/PressStart2P-cyrillic-ifM4FPu.woff2") format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Press Start 2P';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/PressStart2P-latin-ext-1hXOF9o.woff2") format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Press Start 2P';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/PressStart2P-latin-fTXzMc-.woff2") format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- Pixelify Sans (vendored): soft, readable pixel font for general use ---- */
@font-face {
    font-family: 'Pixelify Sans';
    font-style: normal; font-weight: 400; font-display: swap;
    src: url("../fonts/PixelifySans-400-cyrillic-vYvBR0M.woff2") format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Pixelify Sans';
    font-style: normal; font-weight: 400; font-display: swap;
    src: url("../fonts/PixelifySans-400-latin-CZnHfB7.woff2") format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Pixelify Sans';
    font-style: normal; font-weight: 700; font-display: swap;
    src: url("../fonts/PixelifySans-700-cyrillic-ZAFQdff.woff2") format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Pixelify Sans';
    font-style: normal; font-weight: 700; font-display: swap;
    src: url("../fonts/PixelifySans-700-latin-hQmQgmL.woff2") format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- Arcade palette ---- */
:root {
    --bg:       #f4f0e6;  /* warm cream */
    --panel:    #ffffff;
    --ink:      #212529;  /* NES dark */
    --muted:    #5a6066;
    --primary:  #209cee;  /* NES blue */
    --success:  #92cc41;  /* NES green */
    --warning:  #f7d51d;  /* coin yellow */
    --danger:   #e76e55;  /* NES red */
    --pixel:   'Press Start 2P', 'Courier New', monospace;  /* harsh pixel — logo only */
    /* Readable native UI font for headings/titles/prices/chrome. The retro feel
       comes from the pixel logo + nes.css borders + colors, not from hard-to-read text. */
    --display: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --body:    -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ---- Base ---- */
* { box-sizing: border-box; }

body {
    margin: 0;
    background-color: var(--bg);
    /* faint checkerboard, like a game-screen backdrop */
    background-image:
        linear-gradient(45deg, rgba(0,0,0,.025) 25%, transparent 25%, transparent 75%, rgba(0,0,0,.025) 75%),
        linear-gradient(45deg, rgba(0,0,0,.025) 25%, transparent 25%, transparent 75%, rgba(0,0,0,.025) 75%);
    background-size: 32px 32px;
    background-position: 0 0, 16px 16px;
    color: var(--ink);
    font-family: var(--body);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* Soft pixel font on chrome/headings/buttons/labels (readable retro) */
h1, h2, h3, h4,
.pixel,
.nes-btn,
.nav a,
.price,
.tag {
    font-family: var(--display);
    font-weight: 700;
    letter-spacing: .3px;
}

/* The wordmark keeps the classic harsh pixel font (short, iconic) */
.site-title { font-family: var(--pixel); }

/* The green "success" button: white-on-light-green is low contrast.
   Dark text reads far better. */
.nes-btn.is-success { color: #15300a; text-shadow: none; }

img { image-rendering: pixelated; }  /* crunchy retro thumbnails */

a { color: var(--primary); }

/* ---- Header ---- */
.site-header {
    background: var(--ink);
    color: #fff;
    border-bottom: 4px solid var(--warning);
    padding: 18px 20px;
}
.site-header .wrap {
    max-width: 1100px; margin: 0 auto;
    display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.site-title {
    color: var(--warning);
    font-size: 22px;
    text-decoration: none;
    text-shadow: 3px 3px 0 #000;
}
.site-title .blink { color: var(--success); }
.tagline {
    font-family: var(--body);
    color: #cfd3d7;
    font-size: 13px;
    margin-left: auto;
}
.nav { display: flex; align-items: center; gap: 16px; }
.nav a { color: var(--warning); font-size: 15px; text-decoration: none; }
.nav a:hover { color: #fff; }
.nav .nav-user { font-family: var(--display); font-weight: 700; font-size: 14px; color: var(--success); }

/* ---- Layout ---- */
.container { max-width: 1100px; margin: 24px auto; padding: 0 20px; }

.toolbar {
    display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
    margin-bottom: 22px;
}
.toolbar .nes-input { flex: 1; min-width: 200px; }

.section-title {
    font-size: 16px;
    margin: 8px 0 18px;
    color: var(--ink);
}

/* ---- Listing grid ---- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 22px;
}
.card { background: var(--panel); }
.card .thumb {
    width: 100%; height: 150px;
    display: flex; align-items: center; justify-content: center;
    font-size: 40px;
    background: repeating-linear-gradient(45deg, #dfe6ec, #dfe6ec 10px, #eef2f5 10px, #eef2f5 20px);
    border-bottom: 4px solid var(--ink);
}
.card .body { padding: 12px 14px 16px; }
.card .title {
    font-family: var(--display);
    font-weight: 700;
    font-size: 16px;
    line-height: 1.25;
    margin: 0 0 8px;
    min-height: 40px;
}
.card .desc { font-size: 14px; color: var(--muted); margin: 0 0 12px; }
.card .meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.price { color: #2b8a3e; font-size: 15px; line-height: 1.4; }
.loc { font-size: 13px; color: var(--muted); white-space: nowrap; }

/* ---- Login ---- */
.login-box { max-width: 460px; margin: 40px auto; text-align: center; }
.login-box .title { font-size: 14px; }
.login-hint { font-size: 13px; color: #cfd3d7; }
.login-widget { margin: 22px 0; display: flex; justify-content: center; min-height: 50px; }
.login-back { font-size: 12px; }
.login-back a { color: var(--warning); }

.tag {
    display: inline-block; font-size: 11px; padding: 3px 7px;
    background: var(--warning); color: #000; margin-bottom: 8px;
}
.tag.free { background: var(--success); color: #07350f; }

/* ---- Category chips ---- */
.cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.cat-chip {
    font-size: 12px; text-decoration: none; color: var(--ink);
    background: #fff; border: 3px solid var(--ink);
    padding: 6px 10px; white-space: nowrap;
}
.cat-chip:hover { background: var(--warning); }
.cat-chip.is-active { background: var(--ink); color: var(--warning); }

/* ---- Card link ---- */
.card-link { display: block; text-decoration: none; color: inherit; transition: transform .05s; }
.card-link:hover { transform: translate(-2px, -2px); }
.card-link:active { transform: translate(0, 0); }

/* ---- Empty state ---- */
.empty-state { text-align: center; padding: 40px; }
.empty-state .desc { color: var(--muted); margin: 8px 0 18px; }

/* ---- Pager ---- */
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 30px 0; }
.pager-info { font-family: var(--display); font-weight: 700; font-size: 14px; }

/* ---- Listing detail ---- */
.breadcrumb { margin: 0 0 18px; }
.breadcrumb a { color: var(--muted); font-size: 13px; }
.detail { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.detail-media { background: #fff; }
.detail-thumb {
    height: 320px; display: flex; align-items: center; justify-content: center;
    font-size: 120px;
    background: repeating-linear-gradient(45deg, #dfe6ec, #dfe6ec 14px, #eef2f5 14px, #eef2f5 28px);
}
.detail-info .title { font-size: 15px; }
.detail-price { font-family: var(--display); font-weight: 700; font-size: 26px; color: #2b8a3e; margin: 4px 0 14px; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.detail-desc { font-size: 15px; line-height: 1.7; }
.detail-seller { margin: 18px 0; }
.detail-chat { margin-top: 6px; }
.detail-hint { font-size: 12px; color: var(--muted); margin-top: 10px; }
@media (max-width: 720px) { .detail { grid-template-columns: 1fr; } }

/* ---- Forms ---- */
.form-box { max-width: 640px; margin: 10px auto 40px; }
.form-box .title { font-size: 14px; }
.form-box label { display: block; font-family: var(--display); font-weight: 700; font-size: 14px; margin: 16px 0 6px; }
.form-field { margin-bottom: 4px; }
.nes-textarea { width: 100%; font-family: var(--body); }
.form-box .nes-btn { margin-top: 20px; }
ul { list-style: none; padding-left: 0; }
.form-error-icon, .form-box ul li { color: var(--danger); font-size: 12px; }

/* ---- Flash ---- */
.flash {
    max-width: 1100px; margin: 16px auto 0; padding: 12px 16px;
    font-family: var(--display); font-weight: 700; font-size: 15px; border: 4px solid var(--ink);
}
.flash-success { background: var(--success); color: #07350f; }

/* ---- Footer ---- */
.site-footer {
    text-align: center; color: var(--muted);
    font-size: 12px; padding: 30px 20px 50px;
}
.site-footer .pixel { font-size: 14px; }

/* ---- Cursor: drop nes.css's pixel hand-cursor, keep normal system cursors ----
   The retro hand-cursor reads as "very old"; the hybrid theme keeps its look
   from the pixel fonts + borders, not the pointer. */
*, *::before, *::after { cursor: auto; }
a, button, summary, label[for], [role="button"],
.nes-btn, input[type="submit"], input[type="button"], input[type="reset"] {
    cursor: pointer;
}
input, textarea, select { cursor: auto; }
:disabled, .is-disabled { cursor: not-allowed; }

/* ---- Email login ---- */
.login-or {
    display: flex; align-items: center; gap: 12px;
    color: var(--muted); font-size: 12px; margin: 18px 0;
}
.login-or::before, .login-or::after {
    content: ""; flex: 1; height: 2px; background: #44494e;
}
.login-email-btn { width: 100%; }
.login-email-form { margin: 16px 0; text-align: left; }
.login-email-form .nes-field { margin-bottom: 16px; }
.login-email-form label {
    display: block; font-family: var(--display); font-weight: 700;
    font-size: 13px; margin-bottom: 6px;
}
.login-email-form .nes-btn { width: 100%; }
