:root {
  --bg: #f5f9ef;
  --ink: #172418;
  --brand: #0f766e;
  --brand-2: #ca8a04;
  --warn: #b91c1c;
  --card: #ffffffea;
  --border: #d7e2cf;
  --shadow: 0 18px 50px rgba(15, 44, 31, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 10% 12%, #e1f0d8 0%, transparent 45%),
    radial-gradient(circle at 90% 85%, #fde6b6 0%, transparent 45%),
    linear-gradient(125deg, #f3f8ef 0%, #fffdf6 100%);
  display: grid;
  place-items: center;
  padding: 24px;
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  filter: blur(30px);
  pointer-events: none;
  opacity: 0.5;
}

.bg-shape-a {
  width: 280px;
  height: 280px;
  left: -80px;
  top: -60px;
  background: #8dd3c7;
}

.bg-shape-b {
  width: 260px;
  height: 260px;
  right: -70px;
  bottom: -70px;
  background: #fcd34d;
}

.app-shell {
  width: min(980px, 100%);
  position: relative;
  z-index: 2;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.topbar h1 {
  margin: 0;
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: clamp(1.5rem, 3.5vw, 2.3rem);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  min-height: 540px;
  padding: clamp(18px, 4vw, 38px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

.phase-title {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: clamp(2rem, 6vw, 4rem);
  margin: 0;
}

.big-word {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: clamp(2.5rem, 10vw, 6rem);
  text-align: center;
  margin: 14px 0;
  letter-spacing: 0.02em;
}

.center {
  text-align: center;
}

.helper {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  opacity: 0.92;
}

.prep-status {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0;
}

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

.btn {
  border: 0;
  border-radius: 16px;
  padding: 14px 22px;
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-warn {
  background: var(--warn);
  color: #fff;
}

.btn-accent {
  background: var(--brand-2);
  color: #111;
}

.btn-outline {
  background: transparent;
  border: 2px solid #1f3f34;
  color: #1f3f34;
}

.nav-link {
  text-decoration: none;
}

.input {
  width: min(520px, 100%);
  border: 2px solid #b9c9af;
  border-radius: 14px;
  padding: 14px;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  outline: none;
}

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

.list-box {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 14px;
  background: #fafdf8;
}

.instructions-box {
  max-height: none;
  padding: 18px 22px;
}

.instructions-list {
  margin: 0;
  padding-left: 1.4em;
  display: grid;
  gap: 12px;
}

.consultation-card {
  justify-content: flex-start;
}

.consult-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.consult-gate {
  display: grid;
  gap: 12px;
  max-width: 520px;
}

.consult-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 18px;
  min-height: 420px;
}

.file-sidebar,
.file-preview {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fafdf8;
  padding: 16px;
}

.file-list {
  display: grid;
  gap: 10px;
}

.file-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  padding: 12px 14px;
  cursor: pointer;
  color: var(--ink);
}

.file-item span {
  display: block;
  margin-top: 4px;
  font-size: 0.95rem;
  opacity: 0.75;
}

.file-item.is-active {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.json-pre {
  margin: 12px 0 0;
  max-height: 520px;
  overflow: auto;
  padding: 16px;
  border-radius: 14px;
  background: #13211b;
  color: #eef7f2;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.95rem;
  line-height: 1.5;
}

.empty-state {
  opacity: 0.72;
}

.mono {
  font-family: "SFMono-Regular", Consolas, monospace;
}

.score {
  font-size: clamp(1.1rem, 2.4vw, 1.4rem);
  font-weight: 700;
}

.timer {
  font-size: clamp(1.1rem, 2.8vw, 1.6rem);
  font-weight: 700;
  color: #14532d;
}

.admin-dialog {
  border: none;
  padding: 0;
  border-radius: 20px;
  max-width: 760px;
  width: calc(100% - 24px);
}

.admin-dialog::backdrop {
  background: rgba(12, 19, 15, 0.45);
}

.admin-panel {
  background: #fefefc;
  border: 1px solid #e5e7da;
  border-radius: 20px;
  padding: 18px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

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

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .consult-layout {
    grid-template-columns: 1fr;
  }
}
