:root {
  color-scheme: light;
  --bg: #f6f2ea;
  --ink: #1d1a14;
  --accent: #e4572e;
  --accent-dark: #b33d1b;
  --panel: #ffffff;
  --muted: #706757;
  --border: #e0d6c6;
  --font-body: "Space Grotesk", "Segoe UI", sans-serif;
  --font-display: "Press Start 2P", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: linear-gradient(140deg, #f6f2ea 0%, #f2e7d4 50%, #f7f0e4 100%);
  min-height: 100vh;
}

h1,
h2,
h3,
.site-header .brand a {
  font-family: var(--font-display);
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 5vw;
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  backdrop-filter: blur(8px);
}

.site-header a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  margin-left: 18px;
}

.site-header .brand a {
  font-size: 1.3rem;
  letter-spacing: 0.02em;
  margin-left: 0;
}

main {
  padding: 32px 5vw 64px;
}

.hero {
  max-width: 720px;
  margin-bottom: 32px;
}

.hero h1 {
  font-size: clamp(2rem, 3.2vw, 3.4rem);
  margin-bottom: 12px;
}

.hero p {
  font-size: 1.1rem;
  color: var(--muted);
}

.hero-actions {
  margin-top: 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

.btn.secondary {
  background: transparent;
  color: var(--accent-dark);
  border: 2px solid var(--accent-dark);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.card,
.panel,
.profile-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 12px 30px rgba(29, 26, 20, 0.08);
}

.panel {
  margin-top: 28px;
}

.profile {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.form-stack {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.form-stack label {
  font-weight: 600;
}

.form-stack input,
.form-stack textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-family: inherit;
}

.flash {
  list-style: none;
  padding: 12px 16px;
  background: #fff0e6;
  border-radius: 12px;
  border: 1px solid #f0b89b;
  margin-bottom: 24px;
}

.flash li {
  color: #9b3a18;
}

.autotetris-main .flash {
  margin: 32px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.table th,
.table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
}

.table tr.outlined-row {
  outline: 2px dashed var(--accent-dark);
  outline-offset: -1px;
  background: #fff6f1;
}

.muted {
  color: var(--muted);
}

.avatar {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 16px;
  border: 2px solid var(--border);
  margin: 12px 0;
}

.avatar.small {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  margin-right: 10px;
}

.avatar.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f2e7d4;
  color: var(--muted);
}

.player-cell {
  display: flex;
  align-items: center;
}

@media (max-width: 600px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .site-header nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }
}
