/* Изнанка, Starcourt, Архив и Пульт Лаборатории */

/* ================= ИЗНАНКА ================= */
.theme-upside { background: #04060e; color: #d9def7; }
.upside { min-height: calc(100vh - 80px); }
.upside-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 28%, rgba(46, 72, 140, .45), transparent 62%), radial-gradient(ellipse at 85% 95%, rgba(130, 10, 22, .42), transparent 55%), linear-gradient(180deg, #0b1124 0%, #05070f 58%, #020309 100%); }
.lightning { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at 72% 6%, rgba(255, 60, 60, .6), transparent 42%), radial-gradient(ellipse at 18% 14%, rgba(150, 70, 255, .35), transparent 35%); animation: lightning 7.5s infinite; }
@keyframes lightning { 0%, 84%, 100% { opacity: 0; } 85% { opacity: .95; } 86% { opacity: .15; } 88% { opacity: .75; } 92% { opacity: 0; } }
.spores { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.vines { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.vine { position: absolute; top: 0; width: 54px; height: 100%; fill: none; stroke: #131a30; stroke-width: 8; stroke-linecap: round; filter: drop-shadow(0 0 3px rgba(160, 30, 50, .55)); animation: sway 9s ease-in-out infinite; }
.vine path + path { stroke-width: 3.5; }
.vine-left { left: -8px; }
.vine-right { right: -8px; animation-delay: -4s; }
@keyframes sway { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(3px); } }
.upside-inner { position: relative; z-index: 2; text-align: center; padding: 14px 8px 0; }
.upside-head { font-family: var(--display); font-weight: 400; font-size: 30px; letter-spacing: .3em; color: #ff453a; margin: 0 0 6px; text-shadow: 0 0 10px rgba(255, 40, 30, .95), 0 0 30px rgba(255, 40, 30, .55); }
.upside-head::after { content: "ИЗНАНКА"; display: block; transform: scaleY(-1); opacity: .22; margin-top: -9px; text-shadow: none; -webkit-mask-image: linear-gradient(180deg, transparent 25%, #000); mask-image: linear-gradient(180deg, transparent 25%, #000); }
.upside-title { font-size: 26px; color: #fff; text-shadow: 0 0 12px rgba(255, 60, 50, .8); }
.upside-text { max-width: 340px; margin: 6px auto 14px; font-size: 15.5px; color: #c4cbee; }
.upside-text .icon { width: 18px; height: 18px; vertical-align: -3px; }
.chip.dark { background: rgba(255, 59, 48, .14); color: #ff9a91; border: 1px solid rgba(255, 90, 79, .6); }
.others { margin: 18px 0 0; font-size: 12.5px; opacity: .72; }
.others p { margin: 2px 0; }

/* разлом */
.portal { display: block; width: 58%; max-width: 230px; margin: 4px auto 8px; overflow: visible; }
.rift { transform-origin: 100px 160px; }
.rift-halo { fill: #ff2a1a; opacity: .8; animation: breathe 4s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: .5; } 50% { opacity: .95; } }
.rift-rim { fill: #34050a; stroke: #ff5330; stroke-width: 3; }
.rift-vein { fill: none; stroke: #3b0207; stroke-width: 5; opacity: .7; stroke-linecap: round; }
.rift-vein.thin { stroke-width: 2.2; }
.tendrils path { fill: none; stroke: #3a0d17; stroke-width: 5; stroke-linecap: round; filter: drop-shadow(0 0 3px #ff3b30); }
.portal-sealed .rift { transform: scaleX(.34); animation: breathe-rift 4s ease-in-out infinite; }
@keyframes breathe-rift { 0%, 100% { transform: scaleX(.3); } 50% { transform: scaleX(.42); } }
.portal-opening { width: 80%; max-width: 330px; margin-top: 30px; }
.portal-opening .rift { animation: tear 1.7s cubic-bezier(.25, .75, .2, 1) forwards; }
@keyframes tear { 0% { transform: scale(.08, .7); } 45% { transform: scale(1.18, 1.05); } 62% { transform: scale(.92, 1); } 80% { transform: scale(1.35, 1.12); opacity: 1; } 100% { transform: scale(3.4, 1.9); opacity: 0; } }
.flash { position: fixed; inset: 0; background: #ffe9c7; opacity: 0; pointer-events: none; animation: flash 1.7s forwards; }
@keyframes flash { 0%, 66% { opacity: 0; } 80% { opacity: .92; } 100% { opacity: 0; } }
.open-portal { width: 100%; padding: 18px; border-radius: 60px; border: 2px solid #ff9c8a; color: #fff; font-family: var(--display); font-size: 22px; letter-spacing: .05em;
  background: radial-gradient(ellipse at 50% 25%, #ff6a54, #bb0e14 58%, #480308); box-shadow: 0 0 30px rgba(255, 40, 30, .85), inset 0 0 18px rgba(255, 196, 150, .5); animation: throb 2s ease-in-out infinite; }
@keyframes throb { 0%, 100% { box-shadow: 0 0 18px rgba(255, 40, 30, .6), inset 0 0 16px rgba(255, 196, 150, .45); } 50% { box-shadow: 0 0 42px rgba(255, 40, 30, 1), inset 0 0 22px rgba(255, 196, 150, .6); } }

/* стена с гирляндой */
.scan { padding-top: 6px; }
.scan-title { font-family: var(--pixel); font-size: 11px; color: var(--yellow); letter-spacing: 2px; animation: twinkle 1.4s infinite; }
.wall { position: relative; padding: 16px 4px 8px; border-radius: 12px; overflow: hidden;
  background: radial-gradient(circle at 7px 7px, rgba(122, 62, 36, .34) 2.2px, transparent 3.2px) 0 0 / 23px 27px, radial-gradient(circle at 18px 19px, rgba(74, 98, 58, .3) 1.8px, transparent 2.8px) 0 0 / 23px 27px, repeating-linear-gradient(90deg, #bfa67c 0 13px, #b39869 13px 15px, #c7b08a 15px 29px);
  box-shadow: inset 0 0 50px 8px rgba(28, 12, 3, .78), 0 0 0 3px #3a2416; }
.wall-row { position: relative; z-index: 2; display: flex; justify-content: center; gap: 1px; margin-bottom: 8px; }
.wall-letter { display: grid; justify-items: center; width: 8.9%; transform: rotate(var(--tilt)); }
.wall-letter i { position: relative; width: 10px; height: 14px; margin-top: 5px; border-radius: 50% 50% 46% 46%; background: var(--c); opacity: .42; }
.wall-letter i::before { content: ""; position: absolute; left: 2px; top: -5px; width: 6px; height: 7px; border-radius: 2px; background: #1c2a1a; }
.wall-letter b { font-family: var(--display); font-weight: 400; font-size: 23px; line-height: 1.35; color: #171009; }
.wall-letter.lit i { opacity: 1; box-shadow: 0 0 9px 4px var(--c), 0 0 30px 14px var(--c); }
.wall-letter.lit b { text-shadow: 0 0 14px #fff6d0, 0 0 4px #fff; }
.wall-wire { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.wall-wire path { fill: none; stroke: #233a20; stroke-width: 1.7; }
.scan-word { min-height: 26px; margin: 16px 0 4px; font-family: var(--pixel); font-size: 15px; letter-spacing: 3px; color: #fff; word-break: break-all; }
.scan-word span.on { color: var(--yellow); text-shadow: 0 0 10px var(--yellow); }

/* тема и таймер */
.topic-card { margin: 6px 0 12px; }
.topic-card h1 { font-size: 31px; color: #fff; text-shadow: 0 0 14px rgba(255, 60, 50, .9); }
.glitch { position: relative; }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; left: 0; right: 0; top: 0; opacity: .7; clip-path: inset(0 0 100% 0); }
.glitch::before { color: #ff2a1a; transform: translateX(-3px); animation: glitch 3.4s steps(1) infinite; }
.glitch::after { color: var(--cyan); transform: translateX(3px); animation: glitch 2.6s steps(1) infinite reverse; }
@keyframes glitch { 0%, 89% { clip-path: inset(0 0 100% 0); } 91% { clip-path: inset(8% 0 58% 0); } 93% { clip-path: inset(62% 0 10% 0); } 95% { clip-path: inset(32% 0 40% 0); } 97% { clip-path: inset(0 0 100% 0); } }
.card.dark-card { background: rgba(13, 18, 38, .88); border: 1px solid #36447a; color: #dce2ff; text-align: left; }
.card.dark-card h3 { font-family: var(--display); font-weight: 400; color: #ff8a80; }
.frame { list-style: none; margin: 6px 0; padding: 0; text-align: left; counter-reset: step; }
.frame li { counter-increment: step; display: grid; grid-template-columns: 28px 1fr; column-gap: 9px; padding: 7px 9px; border: 1px solid transparent; border-radius: 12px; }
.frame li::before { content: counter(step); grid-row: span 2; align-self: center; display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; background: #202a52; font-weight: 700; font-size: 13px; }
.frame li span { font-size: 12.5px; opacity: .74; }
.frame li.now { border-color: #ff5446; background: rgba(255, 45, 32, .16); box-shadow: 0 0 16px rgba(255, 60, 50, .5); }
.frame li.now::before { background: var(--red); color: #fff; }
.frame li.now span { opacity: 1; }
.fear { margin: 12px 0; }
.fear-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.fear-bulb { display: grid; justify-items: center; align-content: start; gap: 4px; padding: 9px 1px 7px; border-radius: 13px; border: 1px solid #36447a; background: rgba(13, 18, 38, .85); color: #cdd4fb; font-size: 10px; line-height: 1.15; }
.fear-bulb i { width: 15px; height: 21px; border-radius: 50% 50% 45% 45%; background: var(--c); opacity: .45; }
.fear-bulb b { font-size: 14px; }
.fear-bulb.picked { border-color: var(--c); box-shadow: 0 0 14px var(--c); }
.fear-bulb.picked i { opacity: 1; box-shadow: 0 0 15px 4px var(--c); }
.f1 { --c: #34c759; } .f2 { --c: #a3e635; } .f3 { --c: #ffd60a; } .f4 { --c: #ff9f0a; } .f5 { --c: #ff3b30; }
.timer-pick { display: flex; justify-content: center; gap: 10px; color: #cfd6ff; }
.timer-caption { font-family: var(--pixel); font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--yellow); margin: 4px 0; }
.dial { position: relative; width: 218px; height: 218px; margin: 4px auto 8px; }
.dial svg { width: 100%; height: 100%; }
.tick { stroke: #56649f; stroke-width: 2; }
.ring-back { fill: none; stroke: #171f3d; stroke-width: 13; }
.ring { fill: none; stroke: var(--red); stroke-width: 13; stroke-linecap: round; filter: drop-shadow(0 0 7px var(--red)); transition: stroke-dashoffset .2s linear; }
.dial.prep .ring { stroke: var(--cyan); filter: drop-shadow(0 0 7px var(--cyan)); }
.dial.over .ring { stroke: #34c759; filter: drop-shadow(0 0 7px #34c759); }
.dial-time { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--pixel); font-size: 31px; color: #fff; text-shadow: 0 0 12px rgba(255, 60, 50, .95); }
.signal { text-align: left; font-size: 14px; background: rgba(46, 230, 255, .09); border: 1.5px dashed var(--cyan); border-radius: 12px; padding: 9px 11px; }
.theme-upside .btn.ghost { color: #bfe8ff; }
.theme-upside .waiting { text-align: left; }
.theme-upside .mark.ok { color: #6ee7a0; }

/* рассекреченная правда */
.truth { position: relative; margin: 16px 2px 8px; padding: 24px 17px 14px; text-align: left; background: #efe5cc; color: #241a10; border-radius: 6px; transform: rotate(-.7deg); box-shadow: 0 0 34px rgba(255, 80, 50, .42); }
.truth h1 { font-size: 27px; }
.truth-stamp { position: absolute; right: 10px; top: -13px; transform: rotate(7deg); font-family: var(--pixel); font-size: 10px; color: #b3140e; background: #efe5cc; border: 3px double #b3140e; padding: 7px 9px; }
.truth-main { font-size: 16.5px; }
.truth-example { font-size: 14.5px; border-top: 1px dashed #8a7a5a; padding-top: 9px; }
.fear-result b { font-size: 22px; color: var(--yellow); }

/* ================= STARCOURT ================= */
.theme-starcourt { background: #12062b; color: #f5edff; }
.theme-starcourt::before { content: ""; position: fixed; inset: 0; z-index: -1;
  background: radial-gradient(ellipse at 50% -8%, rgba(150, 50, 220, .75), transparent 58%), radial-gradient(ellipse at 50% 108%, rgba(0, 180, 220, .35), transparent 52%), repeating-linear-gradient(90deg, rgba(46, 230, 255, .07) 0 1px, transparent 1px 42px), repeating-linear-gradient(0deg, rgba(255, 79, 216, .07) 0 1px, transparent 1px 42px), #12062b; }
.starsign { display: block; width: 100%; margin: 14px 0 6px; overflow: visible; }
.neon-arc { fill: none; stroke: var(--cyan); stroke-width: 3; stroke-linecap: round; filter: drop-shadow(0 0 6px var(--cyan)); }
.neon-word { font-family: var(--display); font-size: 41px; letter-spacing: 3px; fill: #ffeefc; stroke: #ff4fd8; stroke-width: 1.4; filter: drop-shadow(0 0 6px #ff4fd8) drop-shadow(0 0 18px #ff4fd8); }
.neon-stars path { fill: #ffd60a; filter: drop-shadow(0 0 6px #ffd60a); animation: twinkle 2.2s infinite; }
.neon-sub { font-family: var(--pixel); font-size: 7.5px; fill: var(--cyan); }
.balance { display: flex; justify-content: space-between; align-items: center; margin: 8px 0 12px; padding: 13px 18px; border: 2px solid #ff4fd8; border-radius: 18px; background: rgba(20, 6, 46, .8); box-shadow: 0 0 18px rgba(255, 79, 216, .55), inset 0 0 14px rgba(255, 79, 216, .25); }
.balance b { font-family: var(--pixel); font-size: 20px; color: #ffd60a; text-shadow: 0 0 10px rgba(255, 214, 10, .8); }
.ticket { position: relative; display: flex; align-items: stretch; margin: 11px 0; border-radius: 14px; overflow: hidden; color: #26103d; background: linear-gradient(130deg, #fff2d2 0%, #ffd6ea 60%, #d9f6ff 100%); box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.ticket.locked { filter: saturate(.5) brightness(.86); }
.ticket-icon { display: grid; place-items: center; width: 56px; flex: none; font-size: 31px; }
.ticket-text { flex: 1; display: grid; gap: 2px; align-content: center; padding: 11px 6px; }
.ticket-text b { font-family: var(--display); font-weight: 400; font-size: 16.5px; line-height: 1.2; }
.ticket-text span { font-size: 12px; opacity: .75; }
.ticket-stub { display: grid; justify-items: center; align-content: center; gap: 6px; min-width: 88px; padding: 9px 8px; border-left: 2.5px dashed rgba(38, 16, 61, .55); background: rgba(255, 255, 255, .38); }
.ticket-stub b { font-family: var(--pixel); font-size: 11px; }
.neon-title { font-family: var(--display); font-weight: 400; margin-top: 18px; color: var(--cyan); text-shadow: 0 0 10px rgba(46, 230, 255, .8); }
.card.night { background: rgba(28, 12, 58, .86); border: 1px solid #54329b; color: #f1e9ff; }
.card.night .chip.dark { color: #ffb4ee; border-color: #ff4fd8; background: rgba(255, 79, 216, .12); }
.purchase, .earn p { display: flex; justify-content: space-between; gap: 10px; margin: 7px 0; }
.purchase i { font-style: normal; font-size: 12.5px; opacity: .8; }
.purchase.cancelled { opacity: .5; }
.earn b { color: #ffd60a; }

/* ================= АРХИВ ================= */
.theme-archive { background: #1b162e; color: #f1ecff; }
.theme-archive::before { content: ""; position: fixed; inset: 0; z-index: -1; background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 4px), radial-gradient(ellipse at 20% 0%, rgba(255, 79, 163, .24), transparent 48%), radial-gradient(ellipse at 90% 20%, rgba(46, 230, 255, .18), transparent 44%), #1b162e; }
.vhs { padding-top: 16px; font-size: 29px; text-shadow: 2px 0 rgba(255, 59, 48, .85), -2px 0 rgba(46, 230, 255, .85); }
.subtabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.subtabs button { flex: none; padding: 7px 13px; border-radius: 20px; border: 1.5px solid rgba(255, 255, 255, .28); background: none; font-weight: 700; font-size: 13px; }
.subtabs button.on { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.word.dark { background: rgba(255, 255, 255, .07); }
.word.dark i { color: #c9bce8; }
.flashcard { text-align: center; }
.flashcard b { display: block; font-family: var(--display); font-weight: 400; font-size: 26px; margin-bottom: 6px; }
.flashcard .btn { margin: 4px; }
.theme-archive .field { background: #2a2346; border-color: #4a3f72; color: #fff; }
.theme-archive .note { background: rgba(255, 255, 255, .08); color: #f1ecff; }
.fear-chart { width: 100%; }
.fear-chart .axis { stroke: rgba(255, 255, 255, .14); }
.fear-chart .axis-label { fill: #c9bce8; font-size: 10px; }
.fear-chart .drop { stroke: rgba(255, 255, 255, .4); stroke-width: 2; stroke-dasharray: 3 3; }
.dot-before { fill: #ff6a5e; }
.dot-after { fill: #2ee6ff; }
.legend { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin: 0 4px 0 8px; }
.legend.before { background: #ff6a5e; }
.legend.after { background: #2ee6ff; }

/* ================= ПУЛЬТ ЛАБОРАТОРИИ ================= */
.theme-lab { background: #0c1216; color: #dcebe4; }
.lab-head { display: flex; align-items: center; gap: 10px; padding: 16px 0 4px; }
.lab-head h1 { margin: 0; font-size: 15px; letter-spacing: .17em; color: #58e08c; }
.blink { width: 10px; height: 10px; border-radius: 50%; background: #58e08c; box-shadow: 0 0 10px #58e08c; animation: twinkle 1.6s infinite; }
.lab-tabs button.on { background: #58e08c; border-color: #58e08c; color: #06130c; }
.card.lab { background: #121b21; border: 1px solid #24353f; border-radius: 14px; margin: 9px 0; }
.card.lab.fresh { border-color: #58e08c; }
.lab-title { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: #8fe8b2; margin: 18px 0 6px; }
.month { font-family: var(--display); font-weight: 400; font-size: 17px; margin: 12px 0 4px; }
.theme-lab .field { background: #0f171c; border: 1.5px solid #2d414c; color: #e6f3ed; border-radius: 10px; font-size: 14px; }
.theme-lab .modal { background: #121b21; color: #dcebe4; border-color: #35505c; }
.theme-lab .btn.ghost { color: #dcebe4; }
.btn.lab-btn { background: #58e08c; border-color: #58e08c; color: #06130c; box-shadow: none; }
.mini { min-width: 33px; height: 33px; padding: 0 6px; border-radius: 9px; border: 1px solid #355060; background: #1a2830; color: #e2f1ea; font-weight: 700; font-size: 14px; }
.mini.wide-mini { font-size: 12px; padding: 0 10px; }
.mini:disabled { opacity: .35; }
.plan-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 9px; margin: 6px 0; padding: 9px 10px; background: #121b21; border: 1px solid #24353f; border-left: 5px solid var(--subject, #58e08c); border-radius: 11px; }
.plan-date { min-width: 54px; font-weight: 700; font-size: 12px; color: #9fe3bd; }
.plan-text { flex: 1; min-width: 190px; display: grid; gap: 1px; }
.plan-text b { font-size: 13.5px; line-height: 1.3; }
.plan-text span { font-size: 12.5px; color: #9db1bb; }
.plan-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.plan-row.topic.used, .plan-row.order.done, .plan-row.order.cancelled { opacity: .6; }
.spoiler { margin-top: 6px; padding: 8px 10px; border-radius: 9px; background: #0c1418; border: 1px dashed #4f7284; font-size: 13px; }
.filters { display: flex; flex-wrap: wrap; gap: 5px; margin: 14px 0 4px; }
.filter { padding: 5px 11px; border-radius: 18px; border: 1.5px solid var(--subject); background: none; color: #e2f1ea; font-size: 12.5px; font-weight: 700; }
.filter.on { background: var(--subject); color: #0c1216; }
.legend-line { margin-top: 6px; }
.modal.editor h4 { margin: 14px 0 4px; color: #8fe8b2; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.edit { display: block; margin: 8px 0; }
.edit > span { display: block; font-size: 12px; color: #9db1bb; }
.edit textarea { resize: vertical; }
.edit-block { border-left: 3px solid #2d414c; padding-left: 10px; margin-bottom: 12px; }
.sticky { position: sticky; bottom: -18px; background: #121b21; padding: 10px 0; }
.points-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.points-grid label { font-size: 11.5px; color: #9db1bb; }
.invite { word-break: break-all; font-family: monospace; font-size: 12.5px; background: #0c1418; padding: 8px; border-radius: 8px; }
.history p { display: flex; justify-content: space-between; gap: 8px; margin: 3px 0; font-size: 12.5px; color: #b9cbd3; }
