/* ============================================================
   Nintendo Fresh — design system
   "Toy-like editorial": warm paper, deep ink, coral red + mint,
   chunky rounded cards with hard offset shadows.
   ============================================================ */

:root {
    /* Nintendo-red theme: #E60012 primary, Joy-Con neon blue accent. */
    --paper:     #FAF7F4;
    --ink:       #23252B;
    --ink-soft:  #5C5F6A;
    --ink-faint: rgba(35, 37, 43, .12);
    --red:       #E60012;
    --red-deep:  #B8000E;
    --mint:      #00C3E3;
    --mint-soft: #DFF6FB;
    --yellow:    #FFC93C;
    --card:      #FFFFFF;
    --shadow:    rgba(35, 37, 43, .9);
    --radius:    16px;
    --font-display: "Bricolage Grotesque", "Avenir Next", sans-serif;
    --font-body:    "Instrument Sans", "Segoe UI", system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    font-size: 15.5px;
    line-height: 1.55;
    color: var(--ink);
    background-color: var(--paper);
    background-image: radial-gradient(var(--ink-faint) 1px, transparent 1px);
    background-size: 22px 22px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, .logo { font-family: var(--font-display); letter-spacing: -.02em; }
h1 { font-size: 30px; font-weight: 800; }
h2 { font-size: 21px; font-weight: 800; }
h3 { font-size: 17px; font-weight: 700; }

a { color: var(--ink); text-decoration-color: rgba(230, 0, 18, .45); text-underline-offset: 2px; }
a:hover { color: var(--red); }

.shell { width: 100%; max-width: 1060px; margin: 0 auto; padding: 0 20px; }
main.shell { flex: 1; padding-top: 26px; padding-bottom: 60px; }

.muted { color: var(--ink-soft); }
.tiny { font-size: 12.5px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: var(--card); padding: 8px 14px; z-index: 99; }

/* ---------------- header ---------------- */

.site-head {
    background: var(--paper);
    border-bottom: 2px solid var(--ink);
    position: sticky; top: 0; z-index: 50;
}
.head-row { display: flex; align-items: center; gap: 22px; height: 62px; }

.logo {
    font-size: 24px; font-weight: 800; text-decoration: none; color: var(--ink);
    display: flex; align-items: baseline;
}
.logo span { color: var(--red); }
.logo-dot {
    width: 9px; height: 9px; border-radius: 50%; background: var(--mint);
    margin-left: 3px; align-self: center; margin-top: 8px;
}

.site-nav { display: flex; gap: 4px; }
.nav-link {
    text-decoration: none; font-weight: 600; padding: 7px 14px; border-radius: 999px;
    border: 2px solid transparent;
}
.nav-link:hover { border-color: var(--ink); background: var(--card); color: var(--ink); }

.head-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ---------------- buttons & chips ---------------- */

.btn {
    display: inline-block; font-family: var(--font-body); font-weight: 700; font-size: 15px;
    padding: 11px 22px; border-radius: 999px; text-decoration: none; cursor: pointer;
    border: 2px solid var(--ink); color: #fff; background: var(--red);
    box-shadow: 3px 3px 0 var(--shadow);
    transition: transform .07s ease, box-shadow .07s ease;
}
.btn:hover { color: #fff; background: var(--red-deep); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow); }
.btn-sm { padding: 7px 15px; font-size: 13.5px; }
.btn-ghost { background: var(--card); color: var(--ink); }
.btn-ghost:hover { background: var(--mint-soft); color: var(--ink); }
.btn-danger { background: var(--ink); }
.btn-danger:hover { background: #000; }

.chip {
    display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .04em;
    padding: 2px 8px; border-radius: 999px; border: 1.5px solid var(--ink);
    text-transform: uppercase; vertical-align: 2px;
}
.chip-pro  { background: var(--yellow); }
.chip-role { background: var(--mint); color: #fff; }
.chip-deal { background: var(--red); color: #fff; }
.chip-pin, .chip-lock { background: var(--card); }

.board-chip {
    display: inline-block; font-size: 12.5px; font-weight: 700; text-decoration: none;
    padding: 3px 10px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--mint-soft);
}

.link-btn {
    background: none; border: none; font-family: inherit; font-size: 13px; font-weight: 600;
    color: var(--ink-soft); cursor: pointer; padding: 2px 4px;
}
.link-btn:hover { color: var(--red); }
.inline-form { display: inline; }

/* ---------------- user menu ---------------- */

.user-menu { position: relative; }
.user-chip {
    display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700;
    padding: 5px 12px 5px 6px; border: 2px solid var(--ink); border-radius: 999px; background: var(--card);
}
.avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--ink);
    background: hsl(var(--hue, 20), 75%, 72%);
    font-weight: 800; font-size: 14px; color: var(--ink); flex-shrink: 0;
}
.avatar-sm { width: 24px; height: 24px; font-size: 12px; }
.avatar-xl { width: 72px; height: 72px; font-size: 32px; }

.user-drop {
    display: none; position: absolute; right: 0; top: calc(100% + 8px); min-width: 170px;
    background: var(--card); border: 2px solid var(--ink); border-radius: 12px;
    box-shadow: 4px 4px 0 var(--shadow); overflow: hidden; z-index: 60;
}
.user-menu:hover .user-drop, .user-menu:focus-within .user-drop { display: block; }
.user-drop a, .user-drop button {
    display: block; width: 100%; text-align: left; padding: 10px 14px; text-decoration: none;
    font-family: inherit; font-size: 14px; font-weight: 600; background: none; border: none; cursor: pointer;
    color: var(--ink);
}
.user-drop a:hover, .user-drop button:hover { background: var(--mint-soft); }

/* ---------------- flash ---------------- */

.flash {
    margin-top: 16px; padding: 11px 16px; border: 2px solid var(--ink); border-radius: 12px;
    font-weight: 600; box-shadow: 3px 3px 0 var(--shadow);
    animation: pop-in .25s ease both;
}
.flash-success { background: var(--mint-soft); }
.flash-error   { background: #FDE8E4; }
.flash-info    { background: #FFF4D6; }

/* ---------------- hero ---------------- */

.hero {
    display: grid; grid-template-columns: 1.4fr 1fr; gap: 30px; align-items: center;
    padding: 44px 0 38px;
}
.hero-title {
    font-size: clamp(32px, 5vw, 52px); font-weight: 800; line-height: 1.05;
    animation: rise-in .5s ease both;
}
.hero-title em { font-style: normal; color: var(--red); position: relative; }
.hero-sub { margin-top: 14px; font-size: 17px; color: var(--ink-soft); max-width: 46ch; animation: rise-in .5s .08s ease both; }
.hero-cta { margin-top: 24px; display: flex; gap: 12px; flex-wrap: wrap; animation: rise-in .5s .16s ease both; }

.hero-art { position: relative; height: 240px; }
.art-tile {
    position: absolute; display: grid; place-items: center;
    width: 92px; height: 92px; font-size: 40px;
    background: var(--card); border: 2px solid var(--ink); border-radius: 22px;
    box-shadow: 5px 5px 0 var(--shadow);
    animation: floaty 5s ease-in-out infinite;
}
.art-tile.t1 { left: 8%;  top: 4%;   background: #FFE1DB; }
.art-tile.t2 { right: 6%; top: 18%;  background: #FFF4D6; animation-delay: -1.2s; }
.art-tile.t3 { left: 22%; bottom: 4%; background: var(--mint-soft); animation-delay: -2.6s; }
.art-tile.t4 { right: 24%; bottom: 12%; animation-delay: -3.8s; }

@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-12px) rotate(2deg); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }

/* ---------------- layout ---------------- */

.layout-cols { display: grid; grid-template-columns: 1fr 300px; gap: 26px; align-items: start; }

.section-head {
    display: flex; align-items: baseline; justify-content: space-between;
    margin: 26px 0 14px;
}
.see-all { font-size: 13.5px; font-weight: 700; text-decoration: none; color: var(--ink-soft); }
.see-all:hover { color: var(--red); }

/* ---------------- thread cards ---------------- */

.thread-card {
    display: flex; gap: 14px; background: var(--card);
    border: 2px solid var(--ink); border-radius: var(--radius);
    box-shadow: 4px 4px 0 var(--shadow);
    padding: 14px 16px; margin-bottom: 14px;
    transition: transform .09s ease, box-shadow .09s ease;
    animation: rise-in .35s ease both;
}
.thread-card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--shadow); }

.vote-col {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    min-width: 38px; padding-top: 2px;
}
.vote-inline { display: inline-flex; align-items: center; gap: 5px; }
.vote-btn {
    background: none; border: none; cursor: pointer; font-size: 13px; line-height: 1;
    color: var(--ink-soft); padding: 3px 6px; border-radius: 7px;
    transition: transform .08s ease;
}
.vote-btn:hover { background: var(--mint-soft); color: var(--ink); transform: scale(1.2); }
.vote-btn.up.active { color: var(--red); }
.vote-btn.down.active { color: var(--mint); }
.vote-score { font-weight: 800; font-size: 14.5px; font-variant-numeric: tabular-nums; }

.thread-main { flex: 1; min-width: 0; }
.thread-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; margin-bottom: 5px; }
.thread-meta a { text-decoration: none; }
.thread-title { font-size: 17.5px; line-height: 1.25; }
.thread-title a { text-decoration: none; }
.thread-title a:hover { color: var(--red); }
.thread-foot { display: flex; gap: 14px; margin-top: 7px; font-size: 13px; }
.reply-count { text-decoration: none; font-weight: 700; }

/* ---------------- board pages ---------------- */

.crumbs { font-size: 13px; margin-bottom: 6px; }
.crumbs a { text-decoration: none; color: var(--ink-soft); font-weight: 600; }
.crumbs a:hover { color: var(--red); }

.board-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin-bottom: 18px; }

.sort-row { display: flex; gap: 8px; margin-bottom: 18px; }
.sort-pill {
    text-decoration: none; font-weight: 700; font-size: 13.5px;
    padding: 6px 14px; border: 2px solid var(--ink); border-radius: 999px; background: var(--card);
}
.sort-pill.active { background: var(--ink); color: #fff; }

.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.board-card {
    display: block; text-decoration: none; background: var(--card);
    border: 2px solid var(--ink); border-radius: var(--radius);
    box-shadow: 4px 4px 0 var(--shadow); padding: 20px;
    transition: transform .09s ease, box-shadow .09s ease;
}
.board-card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--shadow); color: var(--ink); }
.board-card-icon { font-size: 30px; display: block; margin-bottom: 8px; }
.board-card p { margin: 6px 0 10px; font-size: 14px; }
.board-stats { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }

.pager { display: flex; justify-content: space-between; margin-top: 22px; }

/* ---------------- thread page ---------------- */

.thread-full {
    background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius);
    box-shadow: 5px 5px 0 var(--shadow); padding: 20px; margin-bottom: 10px;
}
.thread-full-row { display: flex; gap: 16px; }
.thread-full-main { flex: 1; min-width: 0; }
.thread-full-title { font-size: clamp(22px, 3.4vw, 30px); line-height: 1.15; margin-bottom: 10px; }
.thread-body { margin-top: 12px; font-size: 16px; }

.post-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 13.5px; }
.post-author { font-weight: 800; text-decoration: none; }
.post-body { margin: 8px 0 6px; overflow-wrap: break-word; }
.post-body blockquote {
    border-left: 4px solid var(--mint); background: var(--mint-soft);
    padding: 6px 12px; margin: 6px 0; border-radius: 0 8px 8px 0;
}
.post-actions { display: flex; align-items: center; gap: 12px; margin-top: 4px; }

.post-list { margin-top: 10px; }
.post {
    background: var(--card); border: 2px solid var(--ink); border-radius: 14px;
    padding: 13px 16px 9px; margin-bottom: 12px;
}
.post-children { margin-top: 10px; padding-left: 16px; border-left: 3px dotted rgba(35, 37, 43, .25); }
.post-children .post { box-shadow: none; margin-bottom: 10px; }
.post-blocked { font-style: italic; padding: 4px 0; }

.reply-box {
    background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius);
    box-shadow: 4px 4px 0 var(--shadow); padding: 14px; margin: 4px 0 20px;
}
.reply-box textarea { border: 2px solid var(--ink-faint); }
.reply-box-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.replying-to {
    font-size: 13px; font-weight: 600; background: var(--mint-soft);
    border-radius: 8px; padding: 6px 10px; margin-bottom: 8px;
}

/* ---------------- forms ---------------- */

.narrow { max-width: 640px; margin: 0 auto; }
.narrow-auth { max-width: 440px; padding-top: 26px; }
.narrow h1 { margin-bottom: 14px; }

.form-card {
    background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius);
    box-shadow: 4px 4px 0 var(--shadow); padding: 22px; margin-bottom: 22px;
}
.form-title { margin-bottom: 4px; }
.form-danger { border-color: var(--red); }

label { display: block; font-weight: 700; font-size: 13.5px; margin: 14px 0 5px; }
input[type=text], input[type=password], input[type=email], textarea, select {
    width: 100%; padding: 11px 12px; font-size: 15px; font-family: inherit;
    border: 2px solid var(--ink); border-radius: 10px; background: #fff; color: var(--ink);
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(230, 0, 18, .28); }
.form-foot { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.hint { font-size: 12.5px; margin-top: 4px; }

/* ---------------- sidebar ---------------- */

.side-card {
    background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius);
    box-shadow: 4px 4px 0 var(--shadow); padding: 16px; margin-bottom: 20px;
}
.side-title { margin-bottom: 10px; }
.side-board {
    display: flex; gap: 10px; align-items: center; text-decoration: none;
    padding: 8px; border-radius: 10px; font-size: 13.5px; line-height: 1.3;
}
.side-board:hover { background: var(--mint-soft); color: var(--ink); }
.side-board-icon { font-size: 22px; }

.side-card-shop { background: #FFF9EC; }
.side-product { display: flex; gap: 10px; align-items: center; text-decoration: none; padding: 8px; border-radius: 10px; font-size: 13.5px; line-height: 1.35; }
.side-product:hover { background: #fff; color: var(--ink); }
.side-product img { width: 46px; height: 46px; object-fit: contain; border-radius: 8px; background: #fff; border: 1.5px solid var(--ink-faint); }

/* ---------------- profile ---------------- */

.profile-head { display: flex; gap: 18px; align-items: center; margin: 10px 0 8px; }
.profile-bio { margin-top: 6px; max-width: 60ch; }

.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 14px; }
.shelf-game {
    position: relative; border: 2px solid var(--ink); border-radius: 12px; overflow: hidden;
    background: var(--card); box-shadow: 3px 3px 0 var(--shadow); aspect-ratio: 3/4;
}
.shelf-game img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shelf-fallback { display: grid; place-items: center; height: 100%; padding: 8px; font-size: 12.5px; font-weight: 700; text-align: center; }
.shelf-status {
    position: absolute; left: 0; right: 0; bottom: 0; font-size: 10.5px; font-weight: 800;
    text-transform: uppercase; letter-spacing: .04em; text-align: center; padding: 3px;
    background: var(--ink); color: #fff;
}
.shelf-playing  { background: var(--mint); }
.shelf-wishlist { background: var(--yellow); color: var(--ink); }
.shelf-played   { background: var(--ink); }
.shelf-backlog  { background: var(--red); }

/* ---------------- shop ---------------- */

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.product-card {
    position: relative; display: block; text-decoration: none; background: var(--card);
    border: 2px solid var(--ink); border-radius: var(--radius);
    box-shadow: 4px 4px 0 var(--shadow); padding: 16px;
    transition: transform .09s ease, box-shadow .09s ease;
}
.product-card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--shadow); color: var(--ink); }
.product-card img { width: 100%; height: 150px; object-fit: contain; margin-bottom: 10px; }
.product-noimg { display: grid; place-items: center; height: 150px; font-size: 44px; background: var(--mint-soft); border-radius: 10px; margin-bottom: 10px; }
.product-card h3 { font-size: 15.5px; line-height: 1.3; }
.product-card p { font-size: 13px; margin-top: 4px; }
.product-price { display: inline-block; margin-top: 8px; font-weight: 800; font-size: 13.5px; color: var(--red); }
.product-deal { position: absolute; top: 10px; right: 10px; z-index: 2; }

/* ---------------- misc ---------------- */

.empty-card {
    background: var(--card); border: 2px dashed var(--ink); border-radius: var(--radius);
    padding: 26px; text-align: center; margin-bottom: 14px;
}
.empty-card .btn { margin-top: 12px; }

.legal h2 { margin: 22px 0 6px; }
.legal p { margin-bottom: 10px; }

.site-foot { border-top: 2px solid var(--ink); background: var(--card); padding: 26px 0; margin-top: auto; }
.foot-row { display: flex; justify-content: space-between; gap: 24px; font-size: 13.5px; flex-wrap: wrap; }
.foot-nav { display: flex; gap: 16px; }
.foot-nav a { font-weight: 700; text-decoration: none; }

/* ---------------- responsive ---------------- */

@media (max-width: 860px) {
    .layout-cols { grid-template-columns: 1fr; }
    .hero { grid-template-columns: 1fr; padding: 28px 0 20px; }
    .hero-art { display: none; }
    .site-nav { display: none; }
    .board-head { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
    .head-row { gap: 10px; }
    .logo { font-size: 20px; }
    .user-chip-name { display: none; }
    .user-chip { padding: 4px; }
    .head-actions .btn-sm { padding: 7px 11px; font-size: 12.5px; }
    .thread-card { padding: 12px; gap: 10px; }
    .post-children { padding-left: 8px; }
    .foot-row { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
