@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700;800&family=Space+Grotesk:wght@500;700&display=swap');

:root {
  --bg-1: #090e1f;
  --bg-2: #0f274a;
  --panel: rgba(15, 34, 62, 0.84);
  --panel-border: rgba(123, 166, 224, 0.42);
  --panel-2: rgba(22, 46, 80, 0.9);
  --text: #edf5ff;
  --muted: #a7bedf;
  --gold: #ffd166;
  --green: #1fbf7c;
  --yellow: #f0b429;
  --red: #ef6666;
  --chip-shadow: rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  min-height: 100vh;
  font-family: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  background:
    radial-gradient(circle at 8% 8%, #204e85 0%, transparent 25%),
    radial-gradient(circle at 88% 12%, #2f3f8e 0%, transparent 20%),
    linear-gradient(145deg, var(--bg-1), var(--bg-2));
}

.app-shell {
  max-width: 1060px;
  margin: 22px auto 34px;
  padding: 0 14px;
}

.header {
  margin-bottom: 10px;
}

.header h1 {
  margin: 0;
  font-family: 'Space Grotesk', 'Sora', sans-serif;
  font-size: clamp(2.3rem, 4vw, 3.2rem);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.challenge-bar {
  margin-top: 10px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.challenge-toggle {
  border: 1px solid rgba(124, 170, 230, 0.8);
  background: linear-gradient(180deg, #2f6ca5, #23507d);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.challenge-toggle.daily-on {
  border-color: rgba(255, 209, 102, 0.8);
  background: linear-gradient(180deg, #6f5a23, #5a471a);
}

#daily-note {
  color: var(--muted);
  font-size: 0.9rem;
}

#scene {
  width: 100%;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: #0a162b;
  box-shadow: 0 14px 44px rgba(2, 8, 20, 0.45);
  display: block;
}

.tabs {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.tab {
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: rgba(20, 43, 72, 0.75);
  color: var(--text);
  padding: 11px 10px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, background 140ms ease, border-color 140ms ease;
}

.tab:hover {
  transform: translateY(-1px);
  background: rgba(26, 56, 90, 0.9);
}

.tab.active {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(34, 76, 122, 0.95), rgba(25, 56, 94, 0.95));
  box-shadow: 0 0 0 1px rgba(255, 209, 102, 0.25) inset;
}

.panel {
  margin-top: 12px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 16px;
  backdrop-filter: blur(6px);
}

.panel h2 {
  margin: 0 0 8px;
  font-size: 1.8rem;
  font-family: 'Space Grotesk', 'Sora', sans-serif;
}

.panel p {
  margin: 8px 0;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  background: var(--panel-2);
  border: 1px solid rgba(117, 157, 213, 0.55);
  color: var(--text);
  border-radius: 9px;
  padding: 9px 11px;
}

input::placeholder {
  color: #8ea9cd;
}

.action {
  border: 1px solid rgba(124, 170, 230, 0.8);
  background: linear-gradient(180deg, #2f6ca5, #23507d);
  color: var(--text);
  border-radius: 9px;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 120ms ease, filter 120ms ease;
}

.action:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.action:disabled {
  opacity: 0.55;
  cursor: default;
}

.legend {
  display: inline-block;
  margin-right: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.legend.green { background: rgba(31, 191, 124, 0.2); color: #9cf5ca; border: 1px solid rgba(31, 191, 124, 0.5); }
.legend.yellow { background: rgba(240, 180, 41, 0.2); color: #ffd98a; border: 1px solid rgba(240, 180, 41, 0.55); }
.legend.red { background: rgba(239, 102, 102, 0.2); color: #ffc3c3; border: 1px solid rgba(239, 102, 102, 0.55); }

.attempt-list {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.attempt-card {
  border: 1px solid rgba(117, 157, 213, 0.42);
  border-radius: 11px;
  background: rgba(14, 31, 54, 0.75);
  padding: 10px;
}

.attempt-name {
  font-weight: 800;
  margin-bottom: 7px;
  letter-spacing: 0.02em;
}

.attempt-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.6fr 1fr;
  gap: 8px;
}

.hint-box {
  border-radius: 10px;
  border: 1px solid rgba(115, 150, 199, 0.5);
  padding: 8px;
  background: rgba(17, 38, 64, 0.86);
  box-shadow: 0 4px 12px var(--chip-shadow);
}

.hint-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}

.hint-value {
  margin-top: 4px;
  font-size: 0.9rem;
  line-height: 1.35;
}

.hint-meta {
  margin-top: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.hint-green {
  border-color: rgba(31, 191, 124, 0.7);
  background: linear-gradient(145deg, rgba(22, 75, 57, 0.65), rgba(20, 53, 45, 0.85));
}

.hint-yellow {
  border-color: rgba(240, 180, 41, 0.72);
  background: linear-gradient(145deg, rgba(95, 72, 24, 0.66), rgba(70, 53, 21, 0.86));
}

.hint-red {
  border-color: rgba(239, 102, 102, 0.72);
  background: linear-gradient(145deg, rgba(95, 41, 46, 0.66), rgba(70, 30, 36, 0.86));
}

.team-badge-list {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.team-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px 3px 4px;
  border-radius: 999px;
  background: rgba(8, 17, 31, 0.45);
  border: 1px solid rgba(168, 193, 230, 0.4);
  font-size: 0.74rem;
  line-height: 1;
}

.team-badge img,
.team-badge .fallback-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.team-badge img {
  object-fit: cover;
  background: rgba(255, 255, 255, 0.95);
}

.team-badge-fallback .fallback-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #d6e7ff;
  background: rgba(79, 124, 179, 0.85);
}

.good {
  color: #b4ffd8;
  font-weight: 700;
}

.bad {
  color: #ffd0d0;
  font-weight: 700;
}

.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.player-card {
  border: 1px solid rgba(104, 145, 198, 0.55);
  border-radius: 10px;
  background: rgba(20, 45, 74, 0.92);
  padding: 8px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 9px 7px;
  border-bottom: 1px solid rgba(99, 141, 192, 0.42);
  text-align: left;
}

.masked {
  color: #9fc0e2;
}

.footer {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.95rem;
}

.footer p {
  margin: 6px 0;
}

a {
  color: #d8e9ff;
}

.creator-meta {
  font-weight: 600;
}

kbd {
  border: 1px solid rgba(122, 166, 219, 0.7);
  border-radius: 5px;
  background: rgba(18, 40, 68, 0.9);
  padding: 1px 6px;
}

@media (max-width: 860px) {
  .attempt-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .panel {
    padding: 12px;
  }

  .header h1 {
    font-size: 2.1rem;
  }

  .challenge-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}
