:root {
    --text: #e8eaf0;
    --text-muted: #8b93a7;
    --bg: #0d0d12;
    --surface: #1b2236;
    --nav: #1b2236;
    --border: #2a3350;
    --footer: #08080b;
    --footer-text: #aab0c2;
    --accent: #e2884a;
    --accent-hover: #f2a06a;
    --accent-soft: rgba(226, 136, 74, 0.18);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
    --danger-text: #ffb4a0;
    --danger-bg: rgba(255, 138, 101, 0.12);
    --danger-border: rgba(255, 138, 101, 0.35);
    --side-margin: clamp(1rem, 54vw - 33rem, 36rem);
    --radius: 10px;
}

:root[data-theme="light"] {
    --text: #14181f;
    --text-muted: #626b7a;
    --bg: #eef1f5;
    --surface: #ffffff;
    --border: #d7dce3;
    --nav: #ffffff;
    --footer: #14181f;
    --footer-text: #e7eaf0;
    --accent: #b5541f;
    --accent-hover: #963f13;
    --accent-soft: #f4e6da;
    --side-margin: clamp(1rem, 54vw - 33rem, 36rem);
    --radius: 10px;
    --shadow: 0 1px 2px rgba(20, 24, 31, 0.04), 0 4px 14px rgba(20, 24, 31, 0.06);
    --danger-text: #9a3412;
    --danger-bg: #fdf1ea;
    --danger-border: #f0c9ab;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
}

h2 {
  font-size: 2.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  color: var(--text);
}

header {
  font-size: 18px;
  background-color: var(--nav);
  color: var(--text);
  border-bottom: 1px solid var(--border);
  height: fit-content;
}

.header_container {
  margin: 0 var(--side-margin);
  padding: 1.1rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
}

.footer_container {
  margin: 0 var(--side-margin);
  padding: 0.9rem 0;
  display: flex;
  justify-content: space-between;
  color: var(--footer-text);
}

.header_tab {
  font-weight: 500;
  margin-left: 2.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  transition: color 0.15s ease;
}
.header_tab a {
  color: inherit;
}
.header_tab:hover {
  color: var(--accent);
}

.align_right {
  margin-left: auto;
}

footer {
  padding: 0.75rem;
  background-color: var(--footer);
  color: var(--footer-text);
}

main {
  flex: 1 1 0%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg);
  color: var(--text);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.static {
  align-self: stretch;
  margin: 3rem var(--side-margin) 0rem;
  width: 100%;
  padding: 2.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0px 0px;
  box-shadow: var(--shadow);
}

.center {
  text-align: center;
}

.no_select {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

#app_name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--text);
}
#app_name a {
  color: inherit;
}
.game {
    border-radius: 25px;
    padding: 2rem;
    width: 600px;
}
#game_grid {
    height: 100%;
    width: 100%;
    display: flex;
    flex: wrap;
    align-items: stretch;
    justify-content: center;
    gap: 2rem;
}
.game_title {
    font-size: 40px;
    margin-bottom: 0.5rem;
}
.description {
    margin-top: 1rem;
}

/* Form styling */
label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  margin-top: 1.25rem;
}
label:first-of-type {
  margin-top: 0;
}

input[type="email"], input[type="text"], input[type="password"] {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input[type="email"]:focus, input[type="text"]:focus, input[type="password"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

button[type="submit"] {
  margin-top: 1.5rem;
  padding: 0.7rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}
button[type="submit"]:hover {
  background: var(--accent-hover);
}

#setup-error {
  margin-top: 1rem;
  padding: 0.6rem 0.85rem;
  font-size: 0.85rem;
  color: var(--danger-text);
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: 6px;
}

a {
  color: var(--accent);
}
a:hover {
  text-decoration: underline;
}
.profile_menu {
  position: relative;
  margin-left: 2.5rem;
}
.profile_trigger {
  all: unset;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.profile_pic {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--bg);
  display: block;
}
.profile_trigger:hover .profile_pic {
  border-color: var(--accent);
}
.profile_dropdown {
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  min-width: 150px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 0.4rem;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 20;
}
.profile_dropdown.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.profile_dropdown_item {
  display: block;
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text);
  border-radius: 6px;
}
.profile_dropdown_item:hover {
  background: var(--bg);
  color: var(--accent);
  text-decoration: none;
}
.base_body,
.base_header,
.base_footer,
.base_main,
.static,
input,
button[type="submit"] {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.theme_toggle {
  all: unset;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.theme_toggle_track {
  width: 32px;
  height: 17px;
  border-radius: 999px;
  background: var(--border);
  position: relative;
  transition: background 0.2s ease;
}
.theme_toggle_thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, background 0.2s ease;
}
[data-theme="dark"] .theme_toggle_track {
  background: var(--accent);
}
[data-theme="light"] .theme_toggle_thumb {
  transform: translateX(15px);
  background: var(--bg);
}
.theme_toggle_label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  min-width: 2.4rem;
}