@import "tailwindcss";

:root {
  --primary: #00ff88;
  --accent: #00d9ff;
  --danger: #ff0066;
  --warning: #ffaa00;
  --bg1: #0d0d1c;
  --bg2: #16162e;
  --text: #e8f0f7;
  --dim: #8a9cb5;
  --glass: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.14);
  --radius: 16px;
}

html.light {
  --bg1: #f2f4f8;
  --bg2: #e6ebf3;
  --text: #141a24;
  --dim: #5a6779;
  --glass: rgba(15, 20, 30, 0.05);
  --line: rgba(15, 20, 30, 0.12);
  --primary: #00a85a;
  --accent: #0079b8;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  min-height: 100%;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background: transparent;
}

body.app {
  background:
    radial-gradient(circle at 15% 20%, rgba(0, 255, 136, .12) 0%, transparent 45%),
    radial-gradient(circle at 85% 75%, rgba(0, 217, 255, .12) 0%, transparent 45%),
    linear-gradient(150deg, var(--bg1), var(--bg2));
  background-attachment: fixed;
}

body.overlay {
  background: transparent !important;
  overflow: hidden;
}

.display {
  font-family: Rajdhani, sans-serif;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
  border-radius: var(--radius);
}

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 18px 80px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 900px) {
  .g2 {
    grid-template-columns: 1fr 1fr;
  }
  .g3 {
    grid-template-columns: 2fr 1fr;
  }
}

button, .btn {
  font-family: Rajdhani, sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: 13px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  cursor: pointer;
  background: rgba(255, 255, 255, .08);
  color: var(--text);
  transition: .15s;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: .4;
  cursor: not-allowed;
  transform: none;
}

.p {
  background: var(--primary);
  color: #06210f;
  border-color: transparent;
}

.a {
  background: var(--accent);
  color: #04202b;
  border-color: transparent;
}

.d {
  background: var(--danger);
  color: #fff;
  border-color: transparent;
}

.w {
  background: var(--warning);
  color: #2a1d00;
  border-color: transparent;
}

input, select {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .22);
  color: var(--text);
  font-size: 14px;
  outline: none;
}

html.light input {
  background: rgba(255, 255, 255, .7);
}

input:focus {
  border-color: var(--primary);
}

label {
  display: block;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 4px;
}

.card {
  padding: 18px;
}

h2.title {
  font-family: Rajdhani, sans-serif;
  font-size: 12px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 14px;
}

.badge {
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 700;
}

.on {
  background: rgba(0, 255, 136, .18);
  color: var(--primary);
}

.off {
  background: rgba(255, 0, 102, .2);
  color: var(--danger);
}

.hidden {
  display: none !important;
}

/* ---------- overlay graphics ---------- */
#stage {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

#preview {
  position: relative;
  height: 300px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px dashed var(--line);
  background: repeating-conic-gradient(#2a2a44 0% 25%, #22223a 0% 50%) 50% / 24px 24px;
}

#preview #stage {
  position: absolute;
}

.bug {
  position: absolute;
  top: 32px;
  left: 32px;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  animation: swipe .5s cubic-bezier(.16, 1, .3, 1) both;
}

.bug .side {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
}

.bug .side.r {
  flex-direction: row-reverse;
  text-align: right;
}

.bug .logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.bug .logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.bug .nm {
  font-family: Rajdhani, sans-serif;
  font-weight: 800;
  font-size: 20px;
  text-transform: uppercase;
  line-height: 1;
}

.cards {
  display: flex;
  gap: 3px;
  margin-top: 5px;
}

.cards.r {
  justify-content: flex-end;
}

.pip {
  width: 8px;
  height: 12px;
  border-radius: 2px;
}

.pip.y {
  background: var(--warning);
}

.pip.rd {
  background: var(--danger);
}

.goals {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 20px;
  background: rgba(10, 10, 26, .9);
}

.goals span {
  font-family: Rajdhani, sans-serif;
  font-weight: 800;
  font-size: 30px;
  line-height: 1;
}

.clockbox {
  min-width: 108px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  background: rgba(0, 255, 136, .16);
}

.clockbox .c {
  font-family: Rajdhani, sans-serif;
  font-weight: 800;
  font-size: 24px;
  text-shadow: 0 0 18px rgba(0, 255, 136, .5);
}

.clockbox .s {
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: .85;
}

.added {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: var(--warning);
  color: #2a1d00;
  font-family: Rajdhani, sans-serif;
  font-weight: 800;
  font-size: 18px;
}

.pens {
  position: absolute;
  top: 32px;
  right: 32px;
  padding: 10px 22px;
  text-align: center;
  animation: up .45s ease both;
}

.burst {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.burst .inner {
  display: flex;
  gap: 24px;
  align-items: center;
  padding: 32px 48px;
  border-radius: 26px;
  animation: pop .35s cubic-bezier(.22, 1.3, .4, 1) both;
}

.burst .bar {
  width: 8px;
  height: 64px;
  border-radius: 99px;
}

.burst .big {
  font-family: Rajdhani, sans-serif;
  font-weight: 800;
  font-size: 60px;
  line-height: 1;
  text-transform: uppercase;
  animation: flare 2.4s ease-in-out infinite;
}

.burst .sub {
  font-size: 13px;
  letter-spacing: .2em;
  text-transform: uppercase;
  opacity: .8;
  margin-top: 6px;
}

.msg {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 26px;
  animation: up .45s ease both;
}

.msg p {
  font-family: Rajdhani, sans-serif;
  font-weight: 700;
  font-size: 20px;
  text-transform: uppercase;
  text-align: center;
}

.mark {
  position: absolute;
  bottom: 32px;
  right: 32px;
  font-family: Rajdhani, sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .4em;
  text-transform: uppercase;
  opacity: .45;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(.9) translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes up {
  from {
    opacity: 0;
    transform: translate(-50%, 26px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes swipe {
  from {
    opacity: 0;
    transform: translateX(-60px) skewX(-8deg);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes flare {
  0%, 100% {
    opacity: .6;
  }
  50% {
    opacity: 1;
  }
}

.list {
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list .min {
  font-family: Rajdhani, sans-serif;
  font-weight: 800;
  color: var(--primary);
  width: 42px;
  display: inline-block;
}

#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 22px;
  font-size: 14px;
  z-index: 99;
}

.code {
  font-family: Rajdhani, sans-serif;
  font-weight: 800;
  font-size: 30px;
  letter-spacing: .3em;
  text-shadow: 0 0 18px rgba(0, 255, 136, .45);
}
