/* Nakama: warm parchment, moss and chocolate. Loaded after all layout sheets. */
:root {
  color-scheme: light;
  --bg: #f5f2e5;
  --panel: #fffdf3;
  --border: #cdd2bb;
  --muted: #62664f;
  --text: #3b3328;
  --purple: #3e623e;
  --mint: #3d663f;
  --sidebar: #e6ebd9;
  --forest: #3e623e;
  --forest-hover: #2e4e30;
  --cream: #fff8d8;
  --brown: #4e3929;
  --sage: #e8eddc;
  --forest-shadow: 0 8px 26px #3547290a;
}

body {
  background: radial-gradient(ellipse at 85% 0%, #e5ebd8 0, transparent 48%), var(--bg);
  color: var(--text);
}
::selection { background: #c5d5ac; color: #2d4028; }
h1, h2, h3, .brand, .stat-num, .item-identity strong { color: var(--brown); }
.brand { text-decoration: none; }
.brand em, .muted, .intro, .hint, .footer, .section-head span,
.preview-role, .option-labels, .activity small, .activity time,
.stat small, .game-card .sub, .card-bottom,
.login-card small, .login-features, .community-live,
.community-stats span, .community-foot { color: var(--muted); }
.eyebrow, .nav-label, .stat-label { color: #626348; }
.brand-orbit {
  background: linear-gradient(145deg, #647b49, #3f5e39);
  color: var(--cream);
  box-shadow: 0 3px 12px #3b4c2820;
}
.brand-logo, .brand img, .brand-orbit img {
  width: 42px; height: 42px; object-fit: contain; flex-shrink: 0;
}

/* Navigation and the main workspace keep the existing responsive geometry. */
.sidebar { background: var(--sidebar); border-color: var(--border); }
.server { background: #f6f7e9; border-color: #c7ceb1; }
.server-icon, .chooser-icon {
  background: linear-gradient(135deg, #dde5c9, #bdccaa);
  color: #3b5132;
}
.nav button { color: #536146; }
.nav button.active {
  background: #d3dfc2; color: #2f4d30; border-color: #b8c9a2;
}
.nav button:hover { background: #dce5ce; }
.topbar { background: #fffdf3bb; border-color: var(--border); }
.topbar strong { color: #4c4634; }
.avatar { background: #d3dec1; color: #355338; }
.status-dot { color: #38613b; }
.status-dot:before { background: #538245; box-shadow: 0 0 8px #53824528; }
.preview { color: #4b6138; background: #dfe8ce; }
.top-navigation .active { color: #fff9de; background: var(--forest); border-color: var(--forest); }

/* All shared buttons, including generated event controls and modal actions. */
button { background: #e9eddd; color: #3d4630; border-color: #c8ceb7; }
button:hover { background: #dce5cd; border-color: #b4c49c; }
button:disabled { opacity: .52; }
.primary, .button-link {
  background: var(--forest); color: #fff9e2; border-color: var(--forest);
}
.primary:hover, .button-link:hover {
  background: var(--forest-hover); color: #fff9e2; border-color: var(--forest-hover);
}
.quiet { background: transparent; color: #46553b; }
.quiet:hover { background: #e2e8d3; }
.danger { background: #f6e7da; border-color: #d9b9a6; color: #89402f; }
.danger:hover { background: #efd6c5; border-color: #cda08b; }
.link, details summary { color: #38633c; }
.link:hover { color: #243f28; text-decoration: underline; }
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid #567b43; outline-offset: 4px;
}
.guest-link {
  background: transparent !important; color: #3f6037; border-color: #859771;
}
.guest-link:hover { color: #2e4e30; background: #e8eddc !important; border-color: #637d51; }

/* Cards and game identity use the forest palette without dark surfaces. */
.panel, .item-row, .custom-field { background: var(--panel); border-color: var(--border); }
.panel, .item-row, .stat { box-shadow: var(--forest-shadow); }
.stat { background: linear-gradient(125deg, #fffdf0, #eaf0dc); }
.stat-icon { color: #627c45; }
.stat .positive { color: #3d663f; }
.game-art {
  background: radial-gradient(ellipse at 75% 100%, #c0ce9366, transparent 65%),
    linear-gradient(125deg, #e1e7ca, #ced9b7);
  border-color: #c8d2ac;
}
.game-art.green {
  background: radial-gradient(ellipse at 75% 100%, #adbd8f66, transparent 65%),
    linear-gradient(125deg, #d6dfc4, #bfd0ae);
}
.game-monogram, .game-art.green .game-monogram { color: #465537; }
.game-art .art-symbol { color: #52683c; opacity: .65; }
.badge { background: #dce8cc; color: #3c5835; }
.badge.off { background: #eee2d4; color: #745b42; }
.activity li { border-color: #e4e6d6; }
.activity-mark { background: #e4ebd5; color: #4d6a3e; }
.quick-list button { background: #f0f3e5; }
.quick-list button:hover { background: #e0e8d0; }
.quick-list button span:last-child { color: #6c7857; }
.note { color: #535a40; background: #edf1df; border-color: #d1daba; }
.intro-panel { background: linear-gradient(130deg, #e4ebd1, #fffbed); border-color: #bac89e; }
.event-preview { background: #f3f5e7; border-color: #c6d0b0; border-left-color: #668347; }
.event-features { color: #44683c; }

/* Native controls, dropdown search results and dialogs. */
.field>span, .check { color: #4a5039; }
.field small { color: #687055; }
input:not([type=checkbox]), select, textarea {
  background: #fffef8; color: #3b3e2c; border-color: #bcc7a7;
}
input::placeholder, textarea::placeholder { color: #747b63; opacity: 1; }
input:focus, select:focus, textarea:focus {
  border-color: #64824d; outline: 2px solid #77965a33;
}
input[type=checkbox] { accent-color: #486d3f; }
input:disabled, select:disabled, textarea:disabled { background: #ecefdf; color: #6a715b; }
.member-results { background: #fffdf4; border-color: #bac8a5; }
.member-results button { color: #3c4631; border-bottom-color: #dce2cc; }
.member-results button:hover, .member-results button[aria-selected=true] { background: #dce7cb; }
.form-error { color: #923d2c; }
dialog {
  color: var(--text); background: #fffdf2; border-color: #bdc7a7;
  box-shadow: 0 30px 100px #29331c38;
}
dialog::backdrop { background: #28301eb0; backdrop-filter: blur(5px); }
.dialog-head { background: #f0f3e3; }
.dialog-head button { color: #4b573c; }
th { background: #f0f3e4; color: #596247; }
#toast { background: #edf4e2; color: #345333; border-color: #90aa79; box-shadow: 0 10px 40px #283a2026; }
#toast.error { background: #fff0e4; color: #853c2d; border-color: #c6947a; }

/* The calendar is parchment with moss event cards and a clear today marker. */
.calendar-weekdays { background: #e8edd9; color: #586347; }
.calendar-day { background: #fffdf3; border-color: var(--border); }
.calendar-day time { color: #514d38; }
.calendar-day.today { background: #f0f4df; }
.calendar-day.today time { background: var(--forest); color: #fff9df; }
.calendar-day.outside { background: #eaeede; }
.calendar-day.outside time { color: #747f65; }
.calendar-event { background: #e0e9cc; color: #33492e; border-color: #a6ba8c; }
.calendar-event:hover { background: #d1dfb8; }
.calendar-event span, .calendar-event small { color: #536245; }
.calendar-event strong { color: #354c2e; }

/* Public landing page, Discord login and live community information. */
.login {
  background: radial-gradient(ellipse at 8% 55%, #d6e1be66, transparent 58%),
    radial-gradient(ellipse at 90% 12%, #eee7bf88, transparent 50%), #f5f2e5;
}
.login h1 { color: var(--brown); }
.login h1 span { color: #5a743f; }
.login-panel { background: radial-gradient(ellipse at 80% 30%, #d2debb55, transparent 65%); }
.login-card {
  background: #fffdf1; border-color: #c8cfb2;
  box-shadow: 0 18px 55px #4c543415;
}
.discord-join {
  color: #fff9dc; background: #486b3e; border-color: #486b3e;
  box-shadow: 0 8px 26px #455d3424;
}
.discord-join:hover { color: #fff9dc; background: #34552f; border-color: #34552f; }
.community-card {
  background: linear-gradient(135deg, #f2f5e5, #fffbed);
  border-color: #c3cdac; box-shadow: 0 12px 36px #4a583314;
}
.community-head h2 { color: #4c4932; }
.community-live.connected { color: #3c6637; }
.community-live.connected:before { background: #5a823e; box-shadow: 0 0 10px #5a823e33; }
.community-stats strong { color: #4e432e; }
.community-stats div:nth-child(2) strong { color: #466c39; }
.community-foot { border-top-color: #d8dfc5; }
.voice-bars i { background: #64834b; }

@media(max-width:760px) {
  .sidebar.open { box-shadow: 0 0 0 100vw #29331c80; }
}

/* Nakama at night: pine surfaces, sage accents and warm readable text. */
:root[data-theme=dark] {
 color-scheme: dark;
 --bg:#101a14; --panel:#1b2920; --sidebar:#152219; --border:#3a4d3d;
 --text:#e8ecdc; --muted:#b1bda6; --brown:#f0e8cd; --purple:#9bbd83;
 --mint:#a7cc94; --forest:#8cad75; --forest-hover:#a1c38b;
 --cream:#f1ecd4; --sage:#293b2b; --forest-shadow:0 8px 26px #0002;
}
[data-theme=dark] body { background:radial-gradient(ellipse at 85% 0%,#243a2855,transparent 48%),var(--bg); }
[data-theme=dark] ::selection { background:#537443;color:#fff8df; }
[data-theme=dark] .eyebrow,[data-theme=dark] .nav-label,[data-theme=dark] .stat-label { color:#b2c59d; }
[data-theme=dark] .server,[data-theme=dark] .dialog-head,[data-theme=dark] th,
[data-theme=dark] .quick-list button,[data-theme=dark] .calendar-weekdays { background:#233326;color:#d5dfc7;border-color:var(--border); }
[data-theme=dark] .server-icon,[data-theme=dark] .chooser-icon,[data-theme=dark] .avatar,
[data-theme=dark] .activity-mark { background:#344b30;color:#dbe9c7; }
[data-theme=dark] .nav button { color:#c0ccb4; }
[data-theme=dark] .nav button.active { background:#344d31;color:#e6f0d5;border-color:#58734a; }
[data-theme=dark] .nav button:hover { background:#293e2c; }
[data-theme=dark] .topbar { background:#17241be8; }
[data-theme=dark] .topbar strong { color:var(--text); }
[data-theme=dark] button { background:#2b3d2c;color:#e0e9d2;border-color:#496043; }
[data-theme=dark] button:hover { background:#3c5435;border-color:#759461; }
[data-theme=dark] .primary,[data-theme=dark] .button-link,[data-theme=dark] .top-navigation .active,
[data-theme=dark] .discord-join { background:#91b47a;color:#14200f;border-color:#91b47a; }
[data-theme=dark] .primary:hover,[data-theme=dark] .button-link:hover,[data-theme=dark] .discord-join:hover { background:#abc892;color:#14200f;border-color:#abc892; }
[data-theme=dark] .quiet { background:transparent;color:#c9d7bb; }
[data-theme=dark] .quiet:hover { background:#304330; }
[data-theme=dark] .danger { background:#493129;color:#f1c3ac;border-color:#8c6050; }
[data-theme=dark] .danger:hover { background:#5b3a2f; }
[data-theme=dark] .link,[data-theme=dark] details summary { color:#b2d696; }
[data-theme=dark] .guest-link { color:#c0d9ab;border-color:#78966a; }
[data-theme=dark] .guest-link:hover { background:#2c402a !important;color:#e0edcd; }
[data-theme=dark] .stat { background:linear-gradient(125deg,#253827,#1c2b20); }
[data-theme=dark] .stat-icon,[data-theme=dark] .stat .positive,[data-theme=dark] .status-dot,
[data-theme=dark] .event-features,[data-theme=dark] .community-live.connected { color:#b3d597; }
[data-theme=dark] .game-art,[data-theme=dark] .game-art.green { background:radial-gradient(ellipse at 75% 100%,#5b744c44,transparent 65%),linear-gradient(125deg,#354d31,#263b2a);border-color:#4c6542; }
[data-theme=dark] .game-monogram,[data-theme=dark] .game-art.green .game-monogram,[data-theme=dark] .game-art .art-symbol { color:#d0dfb8; }
[data-theme=dark] .badge,[data-theme=dark] .preview { background:#354b2e;color:#d6e9c1; }
[data-theme=dark] .badge.off { background:#463d2e;color:#ddccb0; }
[data-theme=dark] .activity li,[data-theme=dark] .community-foot { border-color:var(--border); }
[data-theme=dark] .quick-list button span:last-child { color:#b2c99f; }
[data-theme=dark] .note,[data-theme=dark] .event-preview { background:#233424;color:#c4d3b2;border-color:#4a6440; }
[data-theme=dark] .intro-panel { background:linear-gradient(130deg,#2e432b,#1c2c20);border-color:#526e43; }
[data-theme=dark] .field>span,[data-theme=dark] .check { color:#d6e0c9; }
[data-theme=dark] .field small { color:var(--muted); }
[data-theme=dark] input:not([type=checkbox]),[data-theme=dark] select,[data-theme=dark] textarea { background:#142118;color:#e9eddf;border-color:#56704c; }
[data-theme=dark] input::placeholder,[data-theme=dark] textarea::placeholder { color:#a0ae94; }
[data-theme=dark] input:disabled,[data-theme=dark] select:disabled,[data-theme=dark] textarea:disabled { background:#263328;color:#a6b39b; }
[data-theme=dark] input[type=checkbox] { accent-color:#9abc7f; }
[data-theme=dark] .member-results,[data-theme=dark] dialog { background:#1c2c20;border-color:#536e46;color:var(--text); }
[data-theme=dark] .member-results button { color:var(--text);border-color:var(--border); }
[data-theme=dark] .member-results button:hover,[data-theme=dark] .member-results button[aria-selected=true] { background:#354e30; }
[data-theme=dark] .dialog-head button { color:#d0dfbc; }
[data-theme=dark] .form-error { color:#f1b6a1; }
[data-theme=dark] #toast { background:#2c442a;color:#e2efcf;border-color:#7b9e63; }
[data-theme=dark] #toast.error { background:#483028;color:#ffd5bf;border-color:#a87861; }
[data-theme=dark] .calendar-day { background:#1b2a1e; }
[data-theme=dark] .calendar-day time { color:#d2ddc3; }
[data-theme=dark] .calendar-day.today { background:#2c4129; }
[data-theme=dark] .calendar-day.today time { color:#13200e; }
[data-theme=dark] .calendar-day.outside { background:#152118; }
[data-theme=dark] .calendar-day.outside time { color:#95a588; }
[data-theme=dark] .calendar-event { background:#344e2e;color:#deebcc;border-color:#648353; }
[data-theme=dark] .calendar-event:hover { background:#425f36; }
[data-theme=dark] .calendar-event strong,[data-theme=dark] .calendar-event span,[data-theme=dark] .calendar-event small { color:#deebcc; }
[data-theme=dark] .login { background:radial-gradient(ellipse at 8% 55%,#36502d55,transparent 58%),radial-gradient(ellipse at 90% 12%,#4c523022,transparent 50%),#101a14; }
[data-theme=dark] .login h1 span { color:#a8c68c; }
[data-theme=dark] .login-panel { background:radial-gradient(ellipse at 80% 30%,#34502d44,transparent 65%); }
[data-theme=dark] .login-card { background:#1c2c20;border-color:#49613e;box-shadow:0 18px 55px #0003; }
[data-theme=dark] .community-card { background:linear-gradient(135deg,#263b28,#1c2c20);border-color:#49613e;box-shadow:0 12px 36px #0002; }
[data-theme=dark] .community-head h2,[data-theme=dark] .community-stats strong { color:#e6e4c9; }
[data-theme=dark] .community-stats div:nth-child(2) strong { color:#bedb9d; }
[data-theme=dark] button:focus-visible,[data-theme=dark] a:focus-visible,[data-theme=dark] summary:focus-visible { outline-color:#b5d599; }
.theme-toggle { white-space:nowrap; }
