/* the page isn't the focused window: decoration rests */
body.idle *, body.idle *::before, body.idle *::after { animation-play-state: paused !important; }
/* a window's open over the home screen: everything behind it holds still */
body.covered :is(.cave, .torch, .slime, header, #homeboard, footer, #richpanel, #onlinepanel, .fly),
body.covered :is(.cave, .torch, .slime, header, #homeboard, footer, #richpanel, #onlinepanel) *,
body.covered header *::before, body.covered header *::after { animation-play-state: paused !important; }
body.covered #sweat, body.covered .fly { visibility: hidden; }
/* the sound list: categories off the screen aren't drawn until you scroll to them, and searching just hides buttons */
#main .cat { content-visibility: auto; contain-intrinsic-size: auto 320px; }
#main .cat[hidden], #main .clip[hidden] { display: none !important; }
/* except the things that carry information, like a crate's prize popping in */
body.idle .ub-card, body.idle #mythcard { animation-play-state: running !important; }
/* the tick clock: always-visible countdowns to the next market and economy ticks */
#tickclock { position: fixed; top: 22px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; gap: 8px; }
/* hovering the clock opens a card under it with what the last tick did */
#tickpeek {
  position: absolute; top: calc(100% + 6px); left: 50%; width: 300px; max-width: calc(100vw - 24px); padding: 10px 12px; border-radius: 14px; text-align: left;
  background: linear-gradient(170deg, rgba(58, 64, 72, 0.97), rgba(21, 24, 30, 0.97)); border: 2px solid rgba(154, 168, 184, 0.45); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  opacity: 0; visibility: hidden; pointer-events: none; transform: translate(-50%, -6px) scale(0.96); transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}
#tickmain:hover + #tickpeek, #tickmain:focus-visible + #tickpeek { opacity: 1; visibility: visible; transform: translate(-50%, 0) scale(1); }
#tickmain:hover { transform: scale(1.05); }
#tickclock { flex-wrap: wrap; justify-content: center; width: max-content; max-width: calc(100vw - 24px); }
#activities { display: contents; }
/* the jukebox: what's on, and the buttons */
.tick.jbox { display: flex; cursor: default; padding: 5px 6px 5px 10px; gap: 4px; max-width: min(360px, calc(100vw - 24px)); }
.jbox .jbname { display: block; max-width: 13em; overflow: hidden; color: var(--ink); -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
.jbox .jbname span { display: inline-block; padding-right: 2em; }
.jbox.long.playing .jbname span { animation: jbscroll 12s linear infinite; }
@keyframes jbscroll { 0%, 15% { transform: translateX(0); } 100% { transform: translateX(-100%); } }
.jbox.paused .jbname { color: var(--ink-dim); }
.jbbtn { width: 30px; height: 30px; flex: none; border-radius: 50%; border: 1px solid rgba(154, 168, 184, 0.5); background: rgba(0, 0, 0, 0.35); color: var(--ink); font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.jbbtn:hover { background: rgba(154, 168, 184, 0.25); transform: scale(1.08); }
.jbbtn.main { width: 34px; height: 34px; font-size: 15px; background: var(--skin); color: #142008; border-color: #142008; }
.jbeq { display: flex; align-items: flex-end; gap: 2px; width: 16px; height: 16px; flex: none; }
.jbeq i { flex: 1; height: 30%; background: var(--skin); border-radius: 1px; }
.jbox.playing .jbeq i { animation: jbeq 0.9s ease-in-out infinite alternate; }
.jbox.playing .jbeq i:nth-child(2) { animation-duration: 0.6s; } .jbox.playing .jbeq i:nth-child(3) { animation-duration: 0.75s; }
@keyframes jbeq { from { height: 20%; } to { height: 100%; } }
.act { position: relative; }
.actchip .ticki .gi { width: 18px; height: 18px; vertical-align: -3px; }
.actchip .tickl { max-width: 9em; overflow: hidden; text-overflow: ellipsis; }
.actchip .tickt { min-width: 0; }
.act .apeek {
  position: absolute; top: calc(100% + 6px); left: 50%; width: 290px; max-width: calc(100vw - 24px); padding: 10px 12px; border-radius: 14px; text-align: left; z-index: 2;
  background: linear-gradient(170deg, rgba(58, 64, 72, 0.97), rgba(21, 24, 30, 0.97)); border: 2px solid rgba(154, 168, 184, 0.45); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  opacity: 0; visibility: hidden; pointer-events: none; transform: translate(-50%, -6px) scale(0.96); transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}
.act:hover .apeek, .actchip:focus-visible + .apeek { opacity: 1; visibility: visible; transform: translate(-50%, 0) scale(1); }
.act:hover .actchip { transform: scale(1.05); }
.act .apeek .tph { font-family: var(--f-ui); font-weight: 800; font-size: 16px; color: var(--skin); margin-bottom: 4px; }
.act .apeek .tpl { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; font-family: var(--f-ui); font-size: 15px; color: var(--ink); }
.act .apeek .tpl b { font-family: var(--f-ui); font-weight: 400; font-size: 12px; white-space: nowrap; }
.act .apeek .tpn { margin-top: 4px; font-family: var(--f-ui); font-size: 14px; color: var(--ink-dim); }
/* the chips trim down as space runs out: labels go first */
@media (max-width: 1400px) { .actchip .tickl { display: none; } }
@media (max-width: 480px) { .act .tick { padding: 6px 9px 9px; font-size: 15px; } .act .tick .tickt { font-size: 12px; } }
#tickpeek .tph { font-family: var(--f-ui); font-weight: 800; font-size: 16px; color: var(--skin); margin-bottom: 4px; }
#tickpeek .tpl { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; font-family: var(--f-ui); font-size: 15px; color: var(--ink); }
#tickpeek .tpl b { font-family: var(--f-ui); font-weight: 400; font-size: 12px; white-space: nowrap; }
#tickpeek .tpt { margin-top: 4px; padding-top: 5px; border-top: 1px dotted rgba(242, 182, 50, 0.4); }
.thtable .gem { color: #ff6b7d; }
#tickpeek .up, .thtable .up { color: #4fe07a; } #tickpeek .down, .thtable .down { color: #ff8a7a; }
#tickpeek .tpn { margin-top: 4px; font-family: var(--f-ui); font-size: 14px; color: var(--ink-dim); }
/* the full history */
#tickhist { position: fixed; inset: 0; z-index: 70; display: none; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 24px 16px; background: rgba(6, 7, 10, 0.75); }
#tickhist.open { display: flex; }
#thbody .thsum { margin: 12px 0 8px; font-family: var(--f-ui); font-size: 17px; color: var(--ink); }
#thbody .hnote { font-family: var(--f-ui); font-size: 16px; color: var(--ink-dim); margin: 14px 0; }
.thwrap { max-height: 60vh; overflow: auto; border-radius: 12px; border: 1px solid rgba(154, 168, 184, 0.3); }
.thtable { width: 100%; border-collapse: collapse; font-family: var(--f-ui); font-size: 15px; color: var(--ink); }
.thtable th { position: sticky; top: 0; padding: 6px 8px; text-align: right; background: #142010; font-weight: 800; color: var(--skin); white-space: nowrap; }
.thtable th:first-child, .thtable td:first-child { text-align: left; }
.thtable td { padding: 4px 8px; text-align: right; border-top: 1px dotted rgba(255, 255, 255, 0.07); font-variant-numeric: tabular-nums; white-space: nowrap; }
.thtable tr.thtot td { font-weight: 800; background: rgba(242, 182, 50, 0.08); }
.thtable tr[title] { cursor: help; }
#tickhist .odds a { color: var(--skin); }
.tick {
  position: relative; display: none; align-items: center; gap: 6px; padding: 7px 12px 10px; overflow: hidden; cursor: pointer; white-space: nowrap;
  border-radius: 14px; background: linear-gradient(170deg, rgba(58, 64, 72, 0.95), rgba(21, 24, 30, 0.95));
  border: 2px solid rgba(154, 168, 184, 0.45); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  font-family: var(--f-ui); font-size: 17px; font-weight: 800; color: var(--skin); letter-spacing: 0.04em;
}
.tick.on { display: flex; }
.tick:hover { border-color: var(--bile); }
.tick .ticki { font-family: initial; }
.tick .tickt { min-width: 2.9em; text-align: right; font-family: var(--f-ui); font-size: 14px; font-weight: 400; color: var(--bile); font-variant-numeric: tabular-nums; }
.tick .tickdelta:empty { display: none; }
.tick .tickdelta { font-family: var(--f-ui); font-size: 12px; font-weight: 400; }
.tick .tickdelta.up { color: #4fe07a; }
.tick .tickdelta.down { color: #ff6b6b; }
.tick .tickbar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0, 0, 0, 0.45); }
.tick .tickbar i { display: block; height: 100%; background: var(--bile); transform-origin: left; transition: transform 0.25s linear; }
.tick.soon { border-color: var(--gold); animation: ticksoon 0.5s ease-in-out infinite alternate; }
.tick.soon .tickt { color: var(--gold); }
.tick.soon .tickbar i { background: var(--gold); }
@keyframes ticksoon { to { box-shadow: 0 0 16px rgba(242, 182, 50, 0.75); } }
.tick.hit { animation: tickhit 1.2s ease-out; }
@keyframes tickhit { 0% { transform: scale(1.15); box-shadow: 0 0 28px rgba(255, 215, 90, 1); border-color: #fff3b0; } 100% { transform: scale(1); } }
/* narrower screens: drop below the corner panels so nothing overlaps */
@media (max-width: 999px) {
  #tickclock { top: 70px; }
  body:not(.locked) header { padding-top: 118px; }
}
/* phones: the corner panel titles wrap onto two lines */
@media (max-width: 480px) {
  #tickclock { top: 102px; }
  body:not(.locked) header { padding-top: 150px; }
}
@media (max-width: 440px) {
  .tick .tickl { display: none; }
}
/* wide screens: keep the header clear of the two corner panels */
@media (min-width: 1200px) {
  body:not(.locked) header { padding-left: 380px; padding-right: 380px; }
  body:not(.locked) h1 { font-size: min(132px, calc((100vw - 800px) / 8.2)); }
}
#onlinehead, #richhead {
  display: flex; align-items: center; gap: 6px; width: 100%; padding: 8px 12px; background: none; border: none; cursor: pointer;
  font-family: var(--f-ui); font-size: 17px; font-weight: 800; color: var(--skin); letter-spacing: 0.04em;
}
#onlinehead b { color: var(--bile); }
#onlinehead .dot { width: 9px; height: 9px; border-radius: 50%; background: #4fe07a; box-shadow: 0 0 8px #4fe07a; }
#onlinehead .caret, #richhead .caret { margin-left: auto; transition: transform 0.2s; }
#onlinepanel:not(.open) .caret { transform: rotate(-90deg); }
#onlinepanel:not(.open) #onlinelist { display: none; }
#onlinelist { list-style: none; margin: 0; padding: 0 10px 10px; max-height: 50vh; overflow-y: auto; text-align: left; }
#onlinelist li { padding: 4px 4px; border-radius: 8px; font-family: var(--f-ui); font-size: 12px; color: var(--ink); }
#onlinelist li.other { cursor: pointer; }
#onlinelist li.other:hover { background: rgba(255, 255, 255, 0.06); }
