/* frunchroom base styles. Retro-lite: Myspace-era boxes, but legible. Profile CSS is scoped under #skin. */
:root {
  --bg: #e8eef6;
  --ink: #1d2733;
  --muted: #6b7a8c;
  --line: #9bb3d1;
  --head: #4f7cb8;
  --head-ink: #fff;
  --link: #0b4fa8;
  --accent: #ff7a1a;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; color: var(--ink); background: var(--bg);
  font: 14px/1.45 Verdana, Tahoma, "Segoe UI", sans-serif;
}
a { color: var(--link); }
img { max-width: 100%; }

.top {
  display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap;
  padding: .6rem 1rem; background: var(--head); color: var(--head-ink);
  border-bottom: 3px solid var(--accent);
}
.top a, .top .soon, .top button { color: var(--head-ink); }
.brand { font: bold 1.5rem Georgia, "Times New Roman", serif; text-decoration: none; letter-spacing: .5px; }
.top nav { display: flex; gap: 1rem; flex: 1; flex-wrap: wrap; }
.top nav a { text-decoration: none; }
.top nav a:hover { text-decoration: underline; }
.soon { opacity: .55; cursor: default; }
.logout { margin: 0; }
.logout button { background: none; border: 1px solid #ffffff88; border-radius: 3px; padding: .15rem .6rem; cursor: pointer; font: inherit; }

.page { max-width: 62rem; margin: 1rem auto; padding: 0 1rem; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 1.5rem 0; }
.pagetitle { font: bold 1.4rem Georgia, serif; margin: .2rem 0 1rem; }
.muted { color: var(--muted); }
.flash { background: #fff6d6; border: 1px solid #e6cf7a; padding: .4rem .7rem; }

.box { background: #fff; border: 1px solid var(--line); margin-bottom: 1rem; }
.box h3 { margin: 0; padding: .3rem .7rem; background: var(--head); color: var(--head-ink); font-size: 13px; }
.box .body, .box > form { padding: .7rem; }
.narrow { max-width: 28rem; margin: 3rem auto; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.row { margin: .3rem 0; }

.btn, button.btn {
  display: inline-block; padding: .3rem .9rem; background: var(--accent); color: #fff; border: 0;
  border-radius: 3px; font: inherit; font-weight: bold; text-decoration: none; cursor: pointer;
}
button.link { background: none; border: 0; padding: 0; color: var(--link); cursor: pointer; font: inherit; text-decoration: underline; }
form.inline { display: inline; margin: 0; }
textarea, input[type=text] { width: 100%; font: inherit; padding: .35rem; border: 1px solid var(--line); }
textarea.code { font-family: Consolas, monospace; font-size: 12px; }
.field { margin-bottom: .8rem; }
.field label { display: block; font-weight: bold; margin-bottom: .15rem; }
.errorlist { color: #b00020; margin: .2rem 0; padding-left: 1rem; }

.badge { display: inline-block; font-size: 11px; padding: 0 .4rem; border: 1px solid var(--line); border-radius: 8px; margin-right: .25rem; }
.badge.mod { border-color: var(--accent); }
.av-sm { width: 28px; height: 28px; border-radius: 3px; vertical-align: middle; margin-right: .3rem; }
.av-md { width: 64px; height: 64px; border-radius: 4px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .8rem; }
.card { display: flex; flex-direction: column; gap: .2rem; align-items: center; text-align: center; padding: .8rem;
        background: #fff; border: 1px solid var(--line); text-decoration: none; color: inherit; }
.card:hover { border-color: var(--accent); }

/* profile */
.p-layout { display: grid; grid-template-columns: 15rem 1fr; gap: 1rem; align-items: start; }
.p-side { background: #fff; border: 1px solid var(--line); padding: .8rem; }
.p-name { font: bold 1.3rem Georgia, serif; margin: 0 0 .5rem; }
.p-avatar { width: 100%; max-width: 200px; border: 1px solid var(--line); }
.p-mood { margin: .6rem 0; }
.p-facts { list-style: none; margin: 0; padding: 0; }
.p-facts li { margin: .25rem 0; }
.wall-comment { display: flex; gap: .6rem; padding: .6rem 0; border-top: 1px dotted var(--line); }
.wall-comment .text p { margin: .2rem 0; }
.wall-comment .meta { font-size: 12px; }
#wall form textarea + button { margin-top: .3rem; }

@media (max-width: 700px) {
  .cols, .p-layout { grid-template-columns: 1fr; }
}

/* bbs */
.crumbs { margin: 0 0 .3rem; color: var(--muted); font-size: 12px; }
.titlebar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.rows > * { padding: .6rem .8rem; border-top: 1px solid #dfe7f2; }
.rows > *:first-child { border-top: 0; }
.row-board, .row-thread { display: grid; grid-template-columns: 1fr 7rem 12rem; gap: .8rem; align-items: start; }
.row-board .title, .row-thread .title { font-weight: bold; font-size: 15px; }
.title.unread { color: var(--ink); }
.dot { color: var(--accent); font-size: 12px; font-weight: bold; text-decoration: none; margin-left: .3rem; }
.count, .last { font-size: 12px; }
.pager { display: flex; gap: 1rem; align-items: center; margin: .6rem 0; }
.modbar { margin: 0 0 .8rem; }
.modbar.inline { display: inline; }
.modbar button.link { margin-right: .6rem; }
.post { display: grid; grid-template-columns: 9rem 1fr; gap: 0; padding: 0; }
.post-who { padding: .8rem; background: #f3f7fc; border-right: 1px solid #dfe7f2; text-align: center; font-size: 12px; }
.post-who strong { display: block; margin-top: .3rem; font-size: 13px; }
.post-main { padding: .8rem; min-width: 0; }
.post-meta { font-size: 12px; margin-bottom: .5rem; }
.post-meta form.inline { margin-left: .5rem; }
.post-body { overflow-wrap: anywhere; }
.post-body p { margin: .4rem 0; }
.post-body blockquote { margin: .5rem 0; padding-left: .8rem; border-left: 3px solid var(--line); color: var(--muted); }
.post-body pre { overflow: auto; background: #f3f7fc; padding: .5rem; }
.reply textarea { min-height: 7rem; }
@media (max-width: 700px) {
  .row-board, .row-thread { grid-template-columns: 1fr; gap: .2rem; }
  .post { grid-template-columns: 1fr; }
  .post-who { display: flex; gap: .6rem; align-items: center; text-align: left; border-right: 0; border-bottom: 1px solid #dfe7f2; }
  .post-who .av-md { width: 36px; height: 36px; }
  .post-who strong { display: inline; margin: 0; }
}

/* status + home */
.home-me { display: flex; gap: 1rem; align-items: flex-start; }
.home-me-main { flex: 1; min-width: 0; }
.home-me .pagetitle { margin-bottom: .4rem; }
.status-form { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.status-form input[type=text] { flex: 1 1 14rem; min-width: 0; }
.status-form select { padding: .35rem; border: 1px solid var(--line); font: inherit; }
.mood { color: var(--muted); font-style: italic; }
.online-dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: #2fb344; margin-right: .3rem; vertical-align: middle; }
.who { display: inline-block; margin: 0 .6rem .2rem 0; }
h4 { margin: .8rem 0 .2rem; font-size: 13px; }

/* calendar */
.viewtabs { margin: 0 0 .8rem; }
.row-event { display: grid; grid-template-columns: 5.5rem 1fr 7rem; gap: .8rem; align-items: start; }
.row-event .title { font-weight: bold; font-size: 15px; }
.row-event.canceled .title, h1.canceled, .chip.canceled { text-decoration: line-through; opacity: .65; }
.rsvp-cell { font-size: 12px; text-align: right; }
.copybox { font: 12px Consolas, monospace; }
.rsvp-buttons { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.btn.off { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.on { background: var(--accent); }
.invitees ul { list-style: none; margin: 0; padding: 0; columns: 2; }
.monthgrid { width: 100%; border-collapse: collapse; table-layout: fixed; background: #fff; }
.monthgrid th { background: var(--head); color: var(--head-ink); padding: .3rem; font-size: 12px; }
.monthgrid td { border: 1px solid var(--line); vertical-align: top; height: 6.5rem; padding: .2rem; overflow: hidden; }
.monthgrid td.out { background: #f1f4f8; color: var(--muted); }
.monthgrid td.today { background: #fff6d6; }
.daynum { display: block; font-size: 11px; color: var(--muted); }
.chip { display: block; font-size: 11px; line-height: 1.25; margin: 2px 0; padding: 1px 3px; background: #e6eefb; border-left: 3px solid var(--head); text-decoration: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chip.going { border-left-color: var(--accent); background: #fff0e3; }
.daylabel { display: none; }
@media (max-width: 700px) {
  .top { gap: .4rem 1rem; }
  .top nav { order: 3; flex-basis: 100%; gap: .4rem .9rem; }
  .row-event { grid-template-columns: 4.5rem 1fr; }
  .rsvp-cell { grid-column: 2; text-align: left; }
  .home-me .av-md { width: 48px; height: 48px; }
  /* month grid -> agenda: only days with events (and today), one per row */
  .monthgrid thead { display: none; }
  .monthgrid, .monthgrid tbody, .monthgrid tr, .monthgrid td { display: block; width: 100%; }
  .monthgrid td { height: auto; border: 0; border-top: 1px solid var(--line); padding: .45rem .7rem; }
  .monthgrid td:not(:has(.chip)):not(.today) { display: none; }
  .monthgrid td.out { background: #fff; color: inherit; }
  .daynum { display: none; }
  .daylabel { display: block; font-weight: bold; font-size: 13px; }
  .chip { font-size: 13px; white-space: normal; padding: 3px 6px; }
}

/* status "is" phrasing + mood never splits from its emoji */
.mood, .nowrap { white-space: nowrap; }
.feed-item { display: flex; gap: .55rem; align-items: flex-start; margin: .5rem 0; }
.feed-item .av-sm { flex: none; margin: 0; }
.feed-item > div { min-width: 0; }
.status-form .is { font-weight: bold; white-space: nowrap; max-width: 45%; overflow: hidden; text-overflow: ellipsis; }
.status-form .is + input[type=text] { flex: 1 1 12rem; }

/* birthdays */
.row-bday { display: grid; grid-template-columns: 5rem 1fr 8rem; gap: .8rem; align-items: center; }
.row-bday.today { background: #fff6d6; }
.chip.bday { border-left-color: #e0509a; background: #fdeaf4; }
.bday-fields select, .bday-fields input[type=number] { padding: .3rem; border: 1px solid var(--line); font: inherit; width: auto; }
.bday-fields input[type=number] { width: 4.5rem; }

/* casino */
.machine { text-align: center; }
.machine .jackpot { font-weight: bold; font-size: 1.05rem; color: #b0142e; }
.reels { display: flex; justify-content: center; gap: .6rem; margin: 1rem 0; font-size: 2.6rem; }
.reel { width: 4.6rem; height: 4.6rem; display: inline-grid; place-items: center; background: #fff;
        border: 2px solid var(--line); border-radius: .5rem; }
.reel > * { grid-area: 1 / 1; font-style: normal; font-weight: normal; }
.swap { display: inline-grid; }
.swap > * { grid-area: 1 / 1; }
.machine .wallet { margin: .4rem 0 .8rem; }
.btn.pull { font-size: 1.05rem; padding: .5rem 1.4rem; }
.outcome { min-height: 1.5rem; margin: .2rem 0; font-weight: bold; }
.outcome .big { color: #b0142e; font-size: 1.1rem; }
/* the reveal: faces flip to symbols one reel at a time (the bot's timing: .9s, 1.8s, then 2.7s, or 3.2s if the
   first two match and it lets it hang). Pure CSS: inline styles are blocked by the CSP. */
.spinning .sym, .spinning .late { opacity: 0; animation: reveal .01s linear forwards; }
.spinning .face, .spinning .pre { animation: vanish .01s linear forwards; }
.spinning .r1 > * { animation-delay: .9s; }
.spinning .r2 > * { animation-delay: 1.8s; }
.spinning .r3 > * { animation-delay: 2.7s; }
.spinning .r3.hang > * { animation-delay: 3.2s; }
.spinning .late, .spinning .pre, .outcome.spinning .late { animation-delay: 2.9s; }
.spinning .late.hang, .spinning .pre.hang { animation-delay: 3.4s; }
@keyframes reveal { to { opacity: 1; } }
@keyframes vanish { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .spinning *, .spinning { animation-delay: 0s !important; } }
.duel { padding: .5rem 0; border-top: 1px dotted var(--line); }
.duel form.inline { margin-left: .6rem; }
.duel-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: .8rem; }
.duel-form select, .duel-form input[type=number] { padding: .35rem; border: 1px solid var(--line); font: inherit; width: auto; }
.duel-form input[type=number] { width: 8rem; }
.home-casino .big { font-size: 1.05rem; }
