/* Fidgit visual identity. Flat surfaces throughout — no shadows, no gradients.
   Old-Reddit-style flat list: hairline dividers, not boxed cards. */

:root {
  --pond: #1F8A70;
  --ember: #E8542E;
  --ink: #1C1B18;
  --paper: #FAF6EE;
  --sand: #F0E9D8;
  --border: #E3DAC6;
  --muted: #6B6558;
  --sans: "Inter", system-ui, sans-serif;
  --display: "Baloo 2", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
}
a { color: var(--pond); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Top nav ---- */
.nav { background: var(--pond); }
.nav-inner {
  max-width: 960px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 20px;
}
.nav .brand {
  margin-right: auto; display: flex; align-items: center;
  background: var(--paper); padding: 5px 11px; border-radius: 9px;
}
.nav .brand img { display: block; }
.nav a { color: var(--paper); font-weight: 500; font-size: 14px; }
.nav .submit {
  background: var(--ember); color: var(--paper);
  padding: 6px 15px; border-radius: 999px; font-weight: 600;
}
.nav .submit:hover { text-decoration: none; filter: brightness(1.05); }
.nav .plus { display: none; } /* mobile only */

/* ---- Page shell ---- */
.wrap { max-width: 960px; margin: 0 auto; padding: 16px; }
.columns { display: grid; grid-template-columns: 1fr 200px; gap: 28px; align-items: start; }

.pill-tabs { display: flex; gap: 8px; margin-bottom: 4px; }
.pill-tabs a {
  font-size: 13px; font-weight: 600; color: var(--muted);
  padding: 4px 12px; border-radius: 999px;
}
.pill-tabs a.active { background: var(--sand); color: var(--pond); }

/* ---- Feed item (grid so the same markup reflows to mobile) ---- */
.feed-item {
  display: grid; column-gap: 12px; row-gap: 2px;
  grid-template-columns: 22px 156px 1fr;
  grid-template-areas:
    "vote thumb tags"
    "vote thumb title"
    "vote thumb tagline"
    "vote thumb meta";
  padding: 16px 0;
  border-bottom: 0.5px solid var(--border);
}
.feed-item .vote { grid-area: vote; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.feed-item .vote button { background: none; border: none; padding: 0; cursor: pointer; color: var(--muted); display: flex; line-height: 1; }
.feed-item .vote button.up.active { color: var(--pond); }
.feed-item .vote button.down.active { color: var(--ember); }
.feed-item .vote .count { font-size: 12px; font-weight: 700; color: var(--ink); }
.feed-item .vote svg { width: 16px; height: 16px; display: block; }

.feed-item .thumb {
  grid-area: thumb; width: 156px; aspect-ratio: 16 / 9; border-radius: 6px;
  background: var(--ink); align-self: start; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: var(--sand); font-family: var(--display); font-size: 12px;
}
.feed-item .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.feed-item .tags { grid-area: tags; display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  background: var(--sand); color: var(--pond);
  font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.tag:hover { text-decoration: none; filter: brightness(0.97); }

.feed-item .title {
  grid-area: title; font-family: var(--display); font-weight: 600; font-size: 15px;
  color: var(--ink); line-height: 1.2; margin: 1px 0;
}
.feed-item .tagline {
  grid-area: tagline; font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.feed-item .meta { grid-area: meta; font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; margin-top: 2px; }
.feed-item .meta .trending { color: var(--ember); font-weight: 600; display: flex; align-items: center; gap: 3px; }
.feed-item .meta svg { width: 13px; height: 13px; vertical-align: -2px; }

/* Mobile-only bottom action row (hidden on desktop) */
.feed-item .actions { grid-area: actions; display: none; }

/* ---- Sidebar widgets (these ARE allowed to be boxed) ---- */
.widget { background: var(--sand); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.widget h4 { margin: 0 0 8px; font-family: var(--display); font-size: 14px; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; }
.widget li .n { color: var(--muted); }
.widget p { margin: 0; font-size: 13px; color: var(--muted); }

/* ---- Content typography ---- */
h1 { font-family: var(--display); font-weight: 700; font-size: 26px; margin: 4px 0 10px; }
h2 { font-family: var(--display); font-weight: 600; font-size: 19px; margin: 20px 0 8px; }
.muted { color: var(--muted); font-size: 13px; }
.center { text-align: center; }

/* ---- Forms & buttons ---- */
.card { max-width: 440px; }
label { display: block; margin: 14px 0 4px; font-weight: 600; font-size: 13px; }
label .hint { font-weight: 400; color: var(--muted); }
input, textarea, select {
  font: inherit; width: 100%; padding: 9px 11px; border: 1px solid var(--border);
  border-radius: 8px; background: #fff; color: var(--ink);
}
input:focus, textarea:focus { outline: none; border-color: var(--pond); }
.counter { float: right; font-weight: 400; color: var(--muted); font-size: 12px; }
.counter.over { color: var(--ember); }
.btn {
  font: inherit; font-weight: 600; cursor: pointer; border: none; border-radius: 999px;
  padding: 9px 18px; background: var(--ember); color: var(--paper);
}
.btn:hover { filter: brightness(1.05); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.secondary { background: var(--sand); color: var(--ink); }
.btn.small { padding: 5px 12px; font-size: 13px; }
.error { color: #b02; margin: 10px 0; font-size: 13px; }
.ok { color: var(--pond); margin: 10px 0; font-size: 13px; font-weight: 600; }

/* ---- Tag input (submit page) ---- */
.taginput { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1px solid var(--border); border-radius: 8px; padding: 6px; background: #fff; }
.taginput input { border: none; padding: 4px; flex: 1; min-width: 120px; }
.taginput input:focus { outline: none; }
.chip { background: var(--sand); color: var(--pond); font-size: 12px; font-weight: 500; padding: 3px 8px; border-radius: 999px; display: inline-flex; gap: 5px; align-items: center; }
.chip button { border: none; background: none; color: var(--pond); cursor: pointer; font-size: 13px; padding: 0; line-height: 1; }
.suggest { position: relative; }
.suggest-list { position: absolute; z-index: 10; left: 0; right: 0; background: #fff; border: 1px solid var(--border); border-radius: 8px; margin-top: 4px; overflow: hidden; }
.suggest-list div { padding: 7px 11px; cursor: pointer; font-size: 13px; display: flex; justify-content: space-between; }
.suggest-list div:hover, .suggest-list div.hi { background: var(--sand); }
.suggest-list .n { color: var(--muted); }

/* ---- Game page ---- */
.game-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.frame-wrap { position: relative; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin: 14px 0; background: #fff; }
iframe.game { width: 100%; height: 520px; border: 0; display: block; }

/* Full-window mode: the game fills the entire browser window. */
.expand-btn {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  border: 0; border-radius: 8px; padding: 6px 10px; cursor: pointer;
  background: rgba(28, 27, 24, .70); color: #fff;
  font: 600 13px var(--sans); line-height: 1;
  display: inline-flex; align-items: center; gap: 6px;
  opacity: .55; transition: opacity .15s ease, background .15s ease;
}
.frame-wrap:hover .expand-btn { opacity: 1; }
.expand-btn:hover { background: rgba(28, 27, 24, .9); opacity: 1; }
.frame-wrap.full-window {
  position: fixed; inset: 0; z-index: 1000; margin: 0;
  border: 0; border-radius: 0;
}
.frame-wrap.full-window iframe.game { height: 100vh; height: 100dvh; }
.frame-wrap.full-window .expand-btn { opacity: 1; }
.vote-bar { display: flex; align-items: center; gap: 10px; }
.vote-bar .score { font-weight: 700; }
.vote-bar button { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 5px 12px; cursor: pointer; color: var(--muted); font-weight: 600; }
.vote-bar button.up.active { color: var(--pond); border-color: var(--pond); }
.vote-bar button.down.active { color: var(--ember); border-color: var(--ember); }

/* ---- Comments ---- */
.comment { border-left: 2px solid var(--border); padding: 4px 0 4px 10px; margin: 6px 0; }
.comment .byline { font-size: 12px; color: var(--muted); }
form.reply { margin: 6px 0; }

/* ---- Status badges (me / admin) ---- */
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--sand); color: var(--muted); }
.badge.pending { background: #FCEED0; color: #8A6D1B; }
.badge.approved { background: #D6EEE4; color: #14684F; }
.badge.rejected, .badge.removed { background: #F7D9CE; color: #A33417; }
.badge.flagged { background: #FBE3CE; color: #9A4A16; }

/* ---- Mobile ---- */
@media (max-width: 640px) {
  .nav .submit { display: none; }
  .nav .plus { display: flex; color: var(--paper); }
  .columns { grid-template-columns: 1fr; gap: 0; }
  .sidebar { display: none; }

  .feed-item {
    grid-template-columns: 1fr;
    grid-template-areas: "tags" "title" "tagline" "thumb" "actions";
    row-gap: 6px;
  }
  .feed-item .vote, .feed-item .meta { display: none; }
  .feed-item .thumb { width: 100%; }
  .feed-item .actions {
    display: flex; gap: 18px; align-items: center; font-size: 13px; color: var(--muted); margin-top: 4px;
  }
  .feed-item .actions .a { display: flex; align-items: center; gap: 5px; }
  .feed-item .actions .a.up.active { color: var(--pond); }
  .feed-item .actions svg { width: 16px; height: 16px; }
  .feed-item .actions .author { margin-left: auto; }
}
