:root {
  --bg-dark: #111520;
  --card-dark: #282e37;
  --text-light: #f8fafc;
  --text-subtle: #94a3b8;
  --accent: #8b5cf6;
  --accent-hover: #7c3aed;
  --border: #334155;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
  background: var(--bg-dark);
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

header {
  width: 100%;
  color: var(--text-light);
  text-align: center;
  padding: 1rem 0;
}

header h1 {
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 1.25px;
}

header #intro {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-subtle);
  margin-top: 0.25rem;
  letter-spacing: 0.5px;
}

#container {
  background: var(--card-dark);
  margin: 1.25rem auto;
  padding: 1.5rem;
  border-radius: 16px;
  width: 100%;
  max-width: 600px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 1rem;
}

#puzzle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  flex: 0 0 50%;
}

#leftop,
#rightop,
#op {
  font-size: 2.5rem;
  font-weight: 600;
}

#row2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

/* Answer input */
#answer {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-dark);
  color: var(--text-light);
  outline: none;
  text-align: center;
}

#answer:focus {
  border-color: var(--accent);
}

/* Give up button */
#pass {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: var(--bg-dark);
  cursor: pointer;
}

#pass:hover {
  background: var(--accent-hover);
}

#config {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
  align-items: flex-start;
  width: 100%;
  flex: 0 0 50%;
}

#levelSelect,
#customTypes {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-dark);
  color: var(--text-light);
  outline: none;
  width: 100%;
}

#levelSelect:focus,
#customTypes:focus {
  border-color: var(--accent);
}

#customTypes {
  display: none;
  resize: none;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1.1rem;
  line-height: 1.4;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-dark);
  color: var(--text-light);
  outline: none;
}

#customInfo {
  display: none;
  width: 100%;
  flex: 0 0 50%;
}

#customInfo summary {
  cursor: pointer;
  color: var(--text-subtle);
}

#customInfo p {
  margin-top: 0.5rem;
  padding-left: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-subtle);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

#reveal {
  font-size: 0.85rem;
  color: var(--text-subtle);
  margin-top: 0.25rem;
  word-break: break-all;
  text-align: center;
  cursor: pointer;
}

footer {
  margin-top: 3rem;
  color: var(--text-subtle);
  font-size: 0.85rem;
}

footer a {
  color: var(--text-subtle);
}

@media (max-width: 480px) {
  #container {
    grid-template-columns: 1fr;
    padding: 1.2rem;
  }
}
