/* Island of Minds: the redesign.
   This sheet sits on top of the game's own styles and changes only how things look, never what they do.
   One system for the whole game, shared with the website: deep-sea glass surfaces, brass for what matters,
   clear type, comfortable spacing, and touch-friendly controls. */
:root {
  --glass: rgba(10, 20, 27, .84);
  --glass-strong: rgba(10, 20, 27, .95);
  --line: rgba(78, 122, 142, .34);
  --line-strong: rgba(98, 146, 168, .5);
  --raise: 0 10px 34px rgba(0, 0, 0, .34), 0 1px 0 rgba(255, 255, 255, .04) inset;
  --r-sm: 8px; --r-md: 12px; --r-lg: 18px;
  --tap: 36px;
}
@media (pointer: coarse) { :root { --tap: 42px; } }
body { font-size: 14.5px; letter-spacing: .003em; }
::selection { background: rgba(233, 180, 76, .35); }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; border-radius: 6px; }

/* ---------- shared surfaces ---------- */
.brand, .chip, .speed, .minds, #panel, #insp, .pop, #zoomCtl button, .toast, #joinSheet, #voteCard, #controlBanner {
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
}
.brand, .chip, .speed, .minds, #zoomCtl button { background: var(--glass); border-color: var(--line); box-shadow: 0 4px 18px rgba(0, 0, 0, .22); }

/* ---------- top bar ---------- */
#top { top: calc(10px + env(safe-area-inset-top)); align-items: center; }
.brand { display: flex; align-items: center; gap: 10px; padding: 7px 14px 7px 9px; border-radius: var(--r-md); }
.brand::before { content: ''; width: 30px; height: 30px; flex: none; border-radius: 9px; background: url(/icons/icon-192.png) center / cover; box-shadow: 0 0 0 1px rgba(255, 255, 255, .06); }
#islandName { font-size: 19px; }
#clock { font-size: 12px; margin-top: 1px; }
.chips { gap: 6px; align-items: center; padding-top: 0; }
.chip { padding: 6px 12px; font-size: 13px; border-radius: 999px; }
.chip .lbl { color: var(--dim); }
.ctrl { gap: 8px; }
.speed { border-radius: var(--r-md); padding: 2px; }
.speed button { border-radius: 9px; min-height: calc(var(--tap) - 4px); padding: 0 11px; font-size: 13px; }
.minds { border-radius: var(--r-md); min-height: var(--tap); padding: 0 13px; font-size: 13px; }
.minds:hover, .speed button:hover { color: var(--paper); }
.join-btn { background: linear-gradient(180deg, rgba(233, 180, 76, .2), rgba(233, 180, 76, .1)) !important; border-color: rgba(233, 180, 76, .6) !important; font-weight: 700; }
#menuBtn { width: var(--tap); padding: 0; justify-content: center; font-size: 17px; }

/* ---------- popovers and menus ---------- */
.pop { background: var(--glass-strong); border-color: var(--line-strong); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--raise); }
.pop h3 { font-size: 17px; margin-bottom: 8px; }
.pop p { font-size: 13.5px; line-height: 1.5; }
#menuPop { width: 280px; padding: 8px; }
#menuPop a, #menuPop button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 0 12px; border-radius: 10px; color: var(--paper); text-decoration: none; background: none; border: 0; font: 14.5px var(--body); text-align: left; cursor: pointer; }
#menuPop a:hover, #menuPop button:hover { background: var(--ink2); }
#menuPop .who { padding: 10px 12px 8px; color: var(--muted); font-size: 13px; border-bottom: 1px solid var(--ink2); margin-bottom: 4px; }
#menuPop .who b { color: var(--paper); display: block; font-size: 15px; }
#menuPop hr { border: 0; border-top: 1px solid var(--ink2); margin: 4px 0; }

/* ---------- the records panel ---------- */
#panel { background: var(--glass-strong); border-color: var(--line); border-radius: var(--r-lg); box-shadow: var(--raise); }
@media (min-width: 1280px) { #panel { width: 430px; } }
.tabbar { padding: 6px 8px 0; border-bottom-color: var(--line); }
#tabs { gap: 4px; padding: 4px 0 8px; }
#tabs button { min-height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13.5px; color: var(--muted); transition: background .15s, color .15s; }
#tabs button:hover { color: var(--paper); background: rgba(255, 255, 255, .04); }
#tabs button[aria-selected="true"] { background: rgba(233, 180, 76, .16); color: var(--paper); box-shadow: inset 0 0 0 1px rgba(233, 180, 76, .45); }
#tabs button .new { top: 4px; right: 4px; }
.tabarrow { border-radius: 999px; background: var(--ink1); border-color: var(--line); }
#tabBody { padding: 14px 16px 24px; }
h2.sec { font-size: 16px; margin: 20px 0 10px; }
.dayhead { background: var(--glass-strong); border-bottom: 1px solid var(--line); margin: 16px -16px 8px; padding: 8px 16px; font-size: 13.5px; }

/* records: events, cards, rows */
.ev { gap: 11px; padding: 10px 6px; border-bottom-color: rgba(40, 68, 82, .55); font-size: 14px; border-radius: 8px; }
.ev:hover { background: rgba(255, 255, 255, .025); }
.ev .ic { width: 22px; font-size: 15px; }
.ev .k { font-size: 10px; letter-spacing: .1em; color: var(--dim); }
.ev.big { border-left-width: 3px; border-radius: 0 8px 8px 0; }
.card, .pcard, .stat, .pnl { border-color: var(--line); border-radius: var(--r-md); }
.card { padding: 12px 14px; margin-bottom: 10px; }
.pcard { padding: 6px 14px 12px; margin: 12px 0; background: rgba(19, 35, 44, .7); }
.scene { border-left-width: 3px; }
.scene header { font-size: 12.5px; }
.line .said { font-size: 14.5px; line-height: 1.55; border-radius: 4px 12px 12px 12px; padding: 7px 11px; background: rgba(255, 255, 255, .045); }
.line .who { font-size: 12.5px; }
.row { padding: 9px 6px; border-radius: 10px; border-bottom-color: rgba(40, 68, 82, .5); }
.row:hover { background: rgba(255, 255, 255, .035); }
.row .av { width: 38px; height: 38px; border-radius: 10px; }
.row .nm { font-size: 14.5px; }
.stat { padding: 10px 12px; background: rgba(19, 35, 44, .75); }
.stat .v { font-size: 20px; }
.kv { font-size: 13.5px; gap: 5px 12px; }
table { font-size: 13px; }
th { font-size: 11px; letter-spacing: .06em; }
td { padding: 7px 4px; border-top-color: rgba(40, 68, 82, .55); }
.pill { font-size: 12px; padding: 2px 9px; }
.empty { font-size: 14px; padding: 18px 6px; }

/* controls */
.btn { min-height: var(--tap); padding: 0 14px; border-radius: 10px; font-size: 13.5px; border-color: var(--line-strong); background: var(--ink2); transition: background .15s, border-color .15s; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { background: var(--ink3); }
.btn.primary { color: #1b1408; }
.btn.primary:hover { filter: brightness(1.06); background: var(--brass); }
.filters button { min-height: 30px; padding: 0 12px; font-size: 12.5px; }
input.search, .ask-bar input, #tabBody textarea, #tabBody input[type="text"] { border-radius: 10px; border-color: var(--line-strong); background: rgba(19, 35, 44, .85); min-height: var(--tap); padding: 8px 12px; }
input.search:focus, #tabBody textarea:focus, #tabBody input:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 3px rgba(233, 180, 76, .18); }
#tabBody select, .pop select, #insp select {
  appearance: none; -webkit-appearance: none; min-height: var(--tap); padding: 0 36px 0 12px; border-radius: 10px;
  background: rgba(19, 35, 44, .85) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%239db0b6' stroke-width='1.8'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--line-strong); color: var(--paper); font-size: 13.5px; cursor: pointer;
}
.linkbtn { font-size: 13px; }
a.ref { text-underline-offset: 3px; }

/* ---------- the inspector (people, buildings, groups) ---------- */
#insp { background: var(--glass-strong); border-color: var(--line); border-radius: var(--r-lg); box-shadow: var(--raise); padding: 16px 18px 24px; }
@media (min-width: 1280px) { #insp { width: 380px; } body.insp-open #zoomCtl { left: 404px; } }
#insp .close { width: 34px; height: 34px; border-radius: 999px; background: var(--ink2); }
#insp .close:hover { background: var(--ink3); }
.hero { gap: 14px; margin-bottom: 14px; }
.hero .av { width: 76px; height: 76px; border-radius: 18px; box-shadow: 0 0 0 1px var(--line); }
.hero h1 { font-size: 24px; letter-spacing: -.01em; }
.status { border-color: var(--line); padding: 3px 11px; }
.quote { border-left-width: 3px; padding-left: 12px; font-size: 14px; }
.mem { font-size: 13px; padding: 6px 0; }
.traits { font-size: 13px; gap: 6px 10px; }
.bar { height: 7px; border-radius: 99px; } .bar i { border-radius: 99px; }

/* ---------- the newspaper keeps its printed look ---------- */
.paper { border-radius: 8px; box-shadow: 0 2px 0 #c9bd9e, 0 12px 30px rgba(0, 0, 0, .3); }

/* ---------- the guide (Ask) ---------- */
.ask-msg { font-size: 14px; padding: 10px 13px; border-radius: 14px; }
.ask-msg.guide { background: rgba(255, 255, 255, .045); border-color: var(--line); }

/* ---------- toasts, zoom, banners ---------- */
.toast { background: var(--glass-strong); border-radius: var(--r-md); box-shadow: var(--raise); padding: 10px 12px 10px 14px; }
#zoomCtl { gap: 6px; }
#zoomCtl button { width: 40px; height: 40px; border-radius: 12px; }
#zoomCtl button:hover { background: var(--ink2); }
#controlBanner { box-shadow: var(--raise); padding: 8px 16px; }
#joinSheet { background: var(--glass-strong); border-left-color: var(--line); }
.js-tabs button { font-size: 14px; }

/* ---------- start and modal screens ---------- */
#start .box, .modal .box { border-color: var(--line-strong); border-radius: 22px; box-shadow: var(--raise); }

/* ---------- tablets ---------- */
@media (max-width: 900px) and (min-width: 701px) {
  #panel, #insp { border-radius: var(--r-lg); }
}

/* ---------- phones ---------- */
@media (max-width: 700px) {
  body { font-size: 15px; }
  .brand { padding: 5px 10px 5px 6px; gap: 8px; }
  .brand::before { width: 26px; height: 26px; border-radius: 8px; }
  #islandName { font-size: 15px; }
  /* watching live: just the green dot and "Live", so there's room for the buttons */
  body.watching #mindsBtn { max-width: none; padding: 0 11px; }
  body.watching #mindsBtn span:last-child { display: none; }
  body.watching #mindsBtn::after { content: 'Live'; font-weight: 700; }
  .brand { max-width: 42vw; }
  .ctrl { flex: none; }
  .ctrl .minds { padding: 0 10px; }
  .join-btn .pw-l { display: inline !important; font-size: 13px; }
  #panel { border-radius: 20px 20px 0 0; background: var(--glass-strong); }
  #tabs button { min-height: 36px; padding: 0 14px; font-size: 14px; }
  #tabBody { padding: 12px 14px calc(24px + env(safe-area-inset-bottom)); }
  .ev { font-size: 14.5px; }
  #insp { border-radius: 20px 20px 0 0; }
  .grab span { width: 44px; background: var(--line-strong); }
  #menuPop { left: 6px; right: 6px; width: auto; }
}
@media (max-width: 429px) { .join-btn .pw-l { display: none !important; } .join-btn { padding: 0 12px !important; } }

/* ---------- people who prefer more contrast or less motion ---------- */
@media (prefers-contrast: more) {
  :root { --line: rgba(160, 200, 215, .7); --line-strong: rgba(190, 220, 230, .85); --muted: #c4d3d8; --dim: #a6b9bf; }
  .brand, .chip, .speed, .minds, #panel, #insp, .pop { background: #08121a; }
}
@media (prefers-reduced-motion: reduce) { #tabs button, .btn { transition: none; } }
.brand-text { min-width: 0; }
@media (max-width: 700px) { .brand-text { overflow: hidden; } }

/* the home page's live background: just the island, no controls */
body.embed #top, body.embed #panel, body.embed #insp, body.embed #zoomCtl, body.embed #toasts, body.embed #joinSheet, body.embed #controlBanner,
body.embed #voteCard, body.embed #menuPop, body.embed .pop, body.embed #start, body.embed #login, body.embed .modal { display: none !important; }
body.embed #map { pointer-events: none; cursor: default; }
