:root{
  --bg: #020617;
  --card-bg: rgba(15,23,42,0.98);
  --accent: #22c55e;
  --accent-soft: #4ade80;
  --border-subtle: rgba(148,163,184,0.5);
  --text-muted: #9ca3af;
}

*{
  box-sizing: border-box;
}

body{
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #0f172a 0, #020617 55%, #000 100%);
  color: #e5e7eb;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 32px 16px;
}

/* page wrapper */
.game-page{
  width: 100%;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* top bar + back button */
.topbar{
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.back-home{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 600;
  color: #e5e7eb;
  border: 1px solid rgba(148,163,184,0.5);
  background: rgba(15,23,42,0.7);
  transition: transform 0.15s ease, background 0.15s ease;
}

.back-home:hover{
  transform: translateY(-1px);
  background: rgba(15,23,42,0.9);
}

/* titles */
.title-block{ margin-bottom: 4px; }

.game-title{
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

.game-subtitle{
  font-size: 1.6rem;
  font-weight: 700;
  color: #f9fafb;
  margin: 4px 0 0;
}

/* shell card */
.game-shell{
  background: var(--card-bg);
  border-radius: 24px;
  padding: 20px 20px 22px;
  box-shadow: 0 24px 50px rgba(0,0,0,0.85);
  border: 1px solid rgba(15,23,42,1);
}

.game-card{
  min-width: 0;
}

/* subtitle text */
.mg-subtitle{
  margin: 0 0 12px 0;
  color: rgba(229,231,235,0.85);
  line-height: 1.4;
}

/* status */
.status-bar{
  min-height: 20px;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.status-info{ color: rgba(229,231,235,0.85); }
.status-good{ color: #4ade80; }
.status-bad{ color: #fb7185; }

/* input row */
.input-row{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

#guess{
  flex: 1 1 280px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,0.45);
  background: rgba(2,6,23,0.75);
  color: #e5e7eb;
  outline: none;
}

#guess:focus{
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 1px rgba(34,197,94,0.6);
}

.btn-primary{
  border-radius: 999px;
  padding: 10px 16px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #022c22;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary:hover{
  background: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(34,197,94,0.35);
}

.reset-link{
  color: rgba(229,231,235,0.85);
  text-decoration: none;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,0.45);
  background: rgba(2,6,23,0.45);
  transition: transform 0.15s ease, background 0.15s ease;
}

.reset-link:hover{
  transform: translateY(-1px);
  background: rgba(2,6,23,0.65);
}

/* legend */
.legend{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 6px;
  color: rgba(229,231,235,0.85);
  font-size: 0.9rem;
}

.legend-item{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.25);
  background: rgba(2,6,23,0.35);
}

.legend-box{
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.legend-box.correct{ background: #22c55e; }
.legend-box.partial{ background: #f59e0b; }
.legend-box.wrong{ background: #ef4444; }

/* results grid */
.results-container{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 12px;
  align-items: start;
}

/* each guess card */
.guess-card{
  border-radius: 18px;
  background: rgba(2,6,23,0.55);
  border: 1px solid rgba(148,163,184,0.35);
  box-shadow: 0 10px 24px rgba(0,0,0,0.55);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 190px;
  transition: transform 0.15s ease;
}

.guess-card:hover{
  transform: translateY(-2px);
}

/* header inside guess card (name + optional image) */
.guess-header{
  padding: 10px 12px;
  border-bottom: 1px solid rgba(148,163,184,0.22);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.guess-name{
  font-weight: 800;
  font-size: 0.95rem;
}

.guess-meta{
  color: rgba(229,231,235,0.65);
  font-size: 0.8rem;
}

/* traits grid inside card */
.traits-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 10px 12px 12px;
}

/* each trait row */
.trait-card{
  border-radius: 14px;
  padding: 8px 10px;
  border: 1px solid rgba(148,163,184,0.25);
  background: rgba(15,23,42,0.65);
}

/* trait label/value */
.trait-label{
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(229,231,235,0.6);
  margin-bottom: 4px;
}

.trait-value{
  font-size: 0.9rem;
  font-weight: 700;
}

/* feedback colors (script adds these classes) */
.correct{
  border-color: rgba(34,197,94,0.75) !important;
  background: rgba(34,197,94,0.10) !important;
}

.partial{
  border-color: rgba(245,158,11,0.80) !important;
  background: rgba(245,158,11,0.12) !important;
}

.wrong{
  border-color: rgba(239,68,68,0.70) !important;
  background: rgba(239,68,68,0.10) !important;
}
