/* kokomoji.art token accounts: one more screen of the Kokomoji wall (the homepage's chassis, bezels, keys and LCDs;
   home/home.css has the long notes on each piece). Progressive, in two layers:
     no wallet yet   the sun TV (connect) and the finder (look up any Kokomoji); the small print folded away
     connected       your Kokomojis come up under the two TVs, each in its own small TV
   Both read straight off the page with :has(#connect[hidden]): accounts.js hides its Connect button once a wallet
   is connected. What accounts/accounts.js builds (the .tok rows, .btn, .pill, .status, the feed and top up forms) is
   styled in home/tokrows.css, shared with the homepage's account channel; this file frames it. accounts.js itself is
   untouched. */

/* the chassis (colours, rack, bezels, keys, LCDs, top strip): home/chassis.css, linked before this file */
.notlive { text-align: center; }

/* ---------------------------------------------------------------- middle: the sun TV and the finder */
.wall { display: grid; grid-template-columns: minmax(0, 1fr) calc(var(--u) * 20.5); gap: calc(var(--u) * 1.1); align-items: stretch; }
.tv { min-width: 0; display: flex; flex-direction: column; }
.tv > .bezel { flex: 1; }

/* before a wallet is connected the sun TV is the page: as tall as the window allows. Once connected it folds down to
   the keypad's height, and your Kokomojis come up under it */
.glass.sun {
  height: clamp(calc(var(--u) * 28), calc(100vh - var(--u) * 15 - var(--foot)), 62vw);
  transition: height .9s var(--ease);
  background: url(../home/stills/center.webp) 50% 40% / cover no-repeat, #0c0716;
}
/* the button sits where the homepage's TV writes "connect wallet", under the mark */
.walletbar {
  position: absolute; z-index: 6; left: 0; right: 0; bottom: 17%;
  display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * .6); padding: 0 6%; text-align: center;
}
.connect { font-size: calc(var(--u) * 1.1); padding: calc(var(--u) * 1) calc(var(--u) * 2.2); letter-spacing: .16em; }
.who { font: 400 calc(var(--u) * .74)/1.3 var(--mono); letter-spacing: .08em; color: rgba(221, 218, 255, .66); text-shadow: 0 1px 6px #000; }
.who b {
  font: 800 calc(var(--u) * 1.05)/1 var(--label); color: var(--red); letter-spacing: .06em;
  text-shadow: 0 0 calc(var(--u) * .45) rgba(236, 48, 19, .7);
}
/* connected: the address in an LCD, where the button was */
.ac:has(#connect[hidden]) .who {
  display: inline-flex; align-items: baseline; gap: .7em; padding: calc(var(--u) * .5) calc(var(--u) * .9);
  border-style: solid; border-width: 0; border-color: transparent;
  border-image: url(../home/art/lcd.webp) 46 fill / calc(var(--u) * .3847) / calc(var(--u) * .1672) stretch;
}
.ac:has(#connect[hidden]) .glass.sun { height: calc(var(--u) * 28); }
.walletbar .status { max-width: 36em; text-shadow: 0 1px 6px #000; }

.glass.pad {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--u) * .7);
  padding: calc(var(--u) * 1) calc(var(--u) * .8);
  background: radial-gradient(90% 70% at 50% 35%, #1d1230, #0a0612 75%);
  --key: clamp(30px, calc(var(--u) * 3.5), 64px);
}
.glass.pad > :not(.fx) { position: relative; z-index: 1; flex-shrink: 0; }
.glass.pad .fx { opacity: .55; }
.readout { display: flex; align-items: center; gap: .15em; width: calc(var(--key) * 3.24); font-size: calc(var(--key) * .5); padding: calc(var(--key) * .14) calc(var(--key) * .24); cursor: text; }
.readout .hash { opacity: .75; }
.readout .field {
  /* the readout is the LCD: the field inside it is bare */
  width: 100%; border: 0; border-image: none; padding: 0; font-size: inherit; letter-spacing: .12em; box-shadow: none;
}
.readout:focus-within { box-shadow: 0 0 0 1px rgba(236, 48, 19, .45), 0 0 calc(var(--u) * 1) rgba(236, 48, 19, .25); }
.pad .keys { display: grid; grid-template-columns: repeat(3, var(--key)); grid-auto-rows: var(--key); gap: calc(var(--key) * .12); }
.pad .keys .key { padding: 0; font-size: calc(var(--key) * .36); letter-spacing: 0; border-image-width: calc(var(--key) * .33); }
.pad .keys .key.fn { font-size: calc(var(--key) * .3); color: var(--lilac); }
.pad .key.go { width: calc(var(--key) * 3.24); padding: calc(var(--key) * .22) 0; border-image-width: calc(var(--key) * .26); font-size: calc(var(--key) * .24); letter-spacing: .26em; }
.pad .status { width: calc(var(--key) * 3.6); text-align: center; }
@keyframes nope { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.pad:has(#lookup-status.err) .readout { animation: nope .35s; }

/* the looked up Kokomoji: only once there is one */
.looked:has(#lookup-out:empty) { display: none; }

/* ---------------------------------------------------------------- yours: a small TV for each Kokomoji */
.mine { grid-column: 1 / -1; display: grid; gap: calc(var(--u) * 1); margin-top: calc(var(--u) * .4); }
.mine .toks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, calc(var(--u) * 30)), 1fr)); gap: calc(var(--u) * 1.3); align-items: start; }
.mine .toks > .empty { grid-column: 1 / -1; text-align: center; }

.mine .tok {
  /* the bezel is the card's own frame; its glass is ::before (the rows are built by accounts.js, so no extra divs) */
  border-style: solid; border-width: 0; border-color: transparent;
  border-image: url(../home/art/bezel-1x.webp) 64 / calc(var(--u) * 4.9694) / calc(var(--u) * 1.1106) stretch;
  padding: calc(var(--u) * 3) calc(var(--u) * 3.1) calc(var(--u) * 3.1) calc(var(--u) * 3);
  filter: drop-shadow(0 calc(var(--u) * .6) calc(var(--u) * 1) rgba(0, 0, 0, .65));
  animation: powerup .7s var(--ease) both;
}
.mine .tok::before {
  content: ""; position: absolute; z-index: 0; inset: calc(var(--u) * 1.9) calc(var(--u) * 2.16) calc(var(--u) * 2) calc(var(--u) * 1.94);
  border-radius: calc(var(--u) * 1.48);
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .18) 0 1px, transparent 1px 3px), radial-gradient(90% 80% at 30% 20%, #1d1230, #0a0612 80%);
  box-shadow: inset 0 0 calc(var(--u) * 2.4) rgba(0, 0, 0, .7), inset 0 0 0 1px rgba(255, 255, 255, .05);
}
@keyframes powerup { 0% { opacity: 0; transform: scaleY(.04); filter: brightness(3); } 55% { opacity: 1; transform: scaleY(1.03); } 100% { transform: none; } }
.mine .tok:nth-child(2) { animation-delay: .08s; } .mine .tok:nth-child(3) { animation-delay: .16s; } .mine .tok:nth-child(4) { animation-delay: .24s; }


/* ---------------------------------------------------------------- bottom: how it works, folded */
.about .bezel { padding: calc(var(--u) * 1.5) calc(var(--u) * 1.8) calc(var(--u) * 1.6); }
.glass.deep {
  padding: calc(var(--u) * 1.3) calc(var(--u) * 1.8);
  background: linear-gradient(180deg, rgba(7, 4, 12, .72), rgba(7, 4, 12, .55)), url(../home/stills/bottom-center.webp) 50% 60% / cover no-repeat, #07040c;
}
.glass.deep > :not(.fx) { position: relative; z-index: 1; }
.intro { margin: 0; max-width: 72em; font-size: calc(var(--u) * .8); line-height: 1.65; color: rgba(221, 218, 255, .8); text-shadow: 0 1px 6px #000; }
.intro b { color: var(--moon); }
.readfirst { margin-top: calc(var(--u) * .9); }
@media (min-width: 1100px) {
  .glass.deep { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: calc(var(--u) * 2.4); align-items: start; }
  .readfirst { margin-top: 0; }
}
.readfirst summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: .7em;
  font: 800 calc(var(--u) * .74)/1.2 var(--label); letter-spacing: .16em; text-transform: uppercase; color: rgba(221, 218, 255, .7);
}
.readfirst summary::-webkit-details-marker { display: none; }
.readfirst summary::before { content: "\25B8"; color: var(--red); transition: transform .2s; }
.readfirst[open] summary::before { transform: rotate(90deg); }
.readfirst summary:hover, .readfirst summary:focus-visible { color: var(--moon); outline: none; }
.notes { margin: calc(var(--u) * .8) 0 0; padding-left: 1.3em; font-size: calc(var(--u) * .76); line-height: 1.6; color: rgba(221, 218, 255, .74); max-width: 72em; }
.notes li { margin: .3em 0; }
.notes li::marker { color: var(--red); }
.notes b { color: var(--moon); font-weight: 600; }

.foot {
  height: var(--foot); display: flex; align-items: center; justify-content: center; gap: 1.2em; flex-wrap: wrap;
  font: 500 10px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: #6b5d95;
}

/* ---------------------------------------------------------------- the layers */
/* no wallet yet: yours stays folded away (it would only say "connect your wallet") */
.ac:has(#connect:not([hidden])) .yours { display: none; }
.ac:has(#connect[hidden]) .yours { animation: rise .6s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---------------------------------------------------------------- tablets and phones */
@media (max-width: 899px) {
  :root { --u: clamp(9px, 1.6vw + .2vh, 14px); }
  .rack { padding: 14px; gap: 12px; }
  .wall { grid-template-columns: 1fr; gap: 12px; }
  .glass.pad { padding: 16px 12px; --key: clamp(38px, 10.5vw, 56px); }
  /* one column: once connected, yours come straight after the sun TV, the finder after them */
  .wallet { order: 0; } .yours { order: 1; } .finder { order: 2; } .looked { order: 3; }
  .glass.sun, .ac:has(#connect[hidden]) .glass.sun { aspect-ratio: 4 / 3; height: auto; }
  .hud { grid-template-columns: auto minmax(0, 1fr) auto; }
  .crumb { grid-column: 2 / 4; grid-row: 1; padding-top: 0; }
  .clock { display: none; }
  .chain { grid-column: 3; grid-row: 1; }
  .lede { grid-column: 1 / -1; grid-row: 3; }
  .logo { grid-row: 1 / span 2; }
  .field { font-size: 16px; }   /* iOS zooms into smaller fields */
}
@media (max-width: 520px) {
  .logo pre { font-size: 4.4px; }
  .crumb { flex-wrap: wrap; }
  .chain { display: none; }
  .tok { grid-template-columns: 64px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .mine .tok, .mine, .pill.off::before, .readout { animation: none !important; }
  .stage, .glass.sun { transition: none; }
}
