/* ============================================================================
   CORAL SPECIES  ·  stylesheet
   ----------------------------------------------------------------------------
   Deep-water shell, the same look as pages/coral-reef. Type comes from
   lib/sci.css. The control panel, its sections and controls, the phone
   dock and sheet and the glass cards come from lib/sn-panel.css (loaded
   last): this file only sets the page tokens and the parts that are not
   the panel. The WebGL canvas fills the frame. Desktop: the panel at the
   left, the readout at the upper right, the legend under it.
     grep -n 'CARD'       the species info card in the panel
     grep -n 'READOUT'    the colony stats card and the legend
     grep -n 'PHONE'      the phone places of the cards (sn-panel.css has the dock)
     grep -n 'LANDSCAPE'  the landscape overrides
     grep -n 'sn-saver'   the screensaver mode
   Text is 12 px or more everywhere (panel-check.mjs reads this file).
   ========================================================================== */
[hidden]{display:none!important}
:root{
  --bg:#02101a; --ink:#d4ecef; --dim:#93b1b7; --faint:#24414b;
  --line:rgba(160,215,225,0.13); --line-b:rgba(160,215,225,0.26);
  --accent:#7fe0cf; --panel-w:300px;
  --gg-accent:#7fe0cf; --gg-dim:#93b1b7}
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{overflow-x:hidden}
html,body{width:100%;height:100%;overflow:hidden;background:var(--bg);overscroll-behavior:none}
body{font-family:var(--sci-sans);color:var(--ink);-webkit-font-smoothing:antialiased}
button{touch-action:manipulation;-webkit-tap-highlight-color:transparent;font-family:inherit}
a{color:var(--accent)}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

.topbar{position:fixed;top:0;left:0;right:0;height:52px;z-index:30;display:flex;align-items:center;gap:16px;padding:0 20px;pointer-events:none}
.brand{font-family:var(--sci-serif);font-size:1.125rem;color:#e8f6f8;display:flex;align-items:center;gap:8px}
.pagetitle{font-size:0.8125rem;color:var(--dim);margin-left:auto}
html.in-frame .topbar{display:none}

#view{position:fixed;inset:0;width:100%;height:100%;display:block;touch-action:none;outline:none;transition:opacity 0.8s ease}
#nogl{position:fixed;left:50%;top:45%;transform:translate(-50%,-50%);z-index:50;padding:16px 20px;border:1px solid var(--line-b);border-radius:12px;background:rgba(2,16,26,0.95);max-width:min(420px,90vw);font-size:0.875rem}

/* CARD: the species info card in the Species section */
.sp-card{padding:12px;border-radius:var(--snp-r);background:var(--snp-raise);font-size:0.8125rem;line-height:1.5;color:var(--snp-dim)}
.sp-card p + p{margin-top:4px}
.sp-card .ic-name{color:var(--snp-ink);font-weight:600}
.sp-card .ic-latin{color:var(--snp-ink)}
.sp-card:empty{display:none}

/* READOUT: the colony stats (sn-panel.css .snp-read) and the legend */
#read{position:fixed;top:12px;right:12px;z-index:22;min-width:184px}
html:not(.in-frame) #read{top:56px}
#read .bar{height:3px;margin:8px 0 4px;background:rgba(160,215,225,0.18);border-radius:2px;overflow:hidden}
#read .bar i{display:block;height:100%;width:0;background:var(--accent);transition:width 0.4s linear}
#hint{position:fixed;left:50%;bottom:16px;transform:translateX(-50%);z-index:20;font-size:0.75rem;color:var(--dim);pointer-events:none;transition:opacity 0.6s;text-align:center;text-shadow:0 1px 6px rgba(0,0,0,0.8)}
#hint.gone{opacity:0}
#legend{position:fixed;right:12px;top:224px;z-index:20;padding:8px 12px;pointer-events:none}
#legend.off{display:none}
.lg-title{font-size:0.75rem;color:var(--dim);margin-bottom:4px}
#lgBar{width:180px;height:8px;border-radius:4px}
.lg-ticks{display:flex;justify-content:space-between;font-size:0.75rem;color:var(--ink);margin-top:4px}
@media (prefers-reduced-motion:reduce){#read .bar i,#hint,#view{transition:none}}

@media(min-width:769px){
  .topbar{padding-left:calc(var(--panel-w) + 20px)}
  body.panel-closed .topbar{padding-left:68px}
}

/* PHONE. The dock and the sheet are in sn-panel.css. */
@media (max-width:768px), (max-height:500px) and (pointer:coarse){
  :root{--dock-h:var(--snp-dock-h)}
  .topbar{height:calc(46px + env(safe-area-inset-top));padding:env(safe-area-inset-top) 16px 0 calc(16px + env(safe-area-inset-left))}
  .pagetitle{display:none}
  #read,html:not(.in-frame) #read{top:calc(52px + env(safe-area-inset-top));right:calc(8px + env(safe-area-inset-right));min-width:0}
  html.in-frame #read{top:8px}
  #read .rd-more{display:none}
  #legend{right:auto;left:calc(8px + env(safe-area-inset-left));top:auto;bottom:calc(var(--dock-h) + 8px);padding:8px}
  #lgBar{width:110px}
  #hint{bottom:auto;top:calc(52px + env(safe-area-inset-top));left:16px;right:150px;transform:none;line-height:1.5;text-align:left}
  html.in-frame #hint{top:8px}
  body:not(.panel-closed) #hint,body:not(.panel-closed) #legend{opacity:0}
}

/* LANDSCAPE phone: the panel is a drawer at the right (sn-panel.css). */
@media (max-height:500px) and (orientation:landscape){
  .topbar{display:none}
  #read,html:not(.in-frame) #read{top:8px}
  #legend{bottom:auto;top:8px}
  #hint,html.in-frame #hint{top:auto;bottom:calc(var(--dock-h) + 8px);left:60vw;right:8px}
}

/* sn-saver (lib/screensaver.js): the colony alone fills the frame */
html.sn-saver #panel,html.sn-saver #dock,html.sn-saver #read,html.sn-saver #legend,html.sn-saver #hint,html.sn-saver #gear,html.sn-saver .topbar{display:none!important}
html.sn-saver #view{cursor:none}
