:root {
  --bg-a: #0d1117;
  --bg-b: #161b22;
  --ink: #e6edf3;
  --muted: #9ba7b4;
  --accent: #2ea97e;
  --accent-strong: #1f7a5b;
  --surface: rgba(22, 27, 34, 0.9);
  --ring: rgba(46, 169, 126, 0.35);
  --danger: #ff6b6b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100svh;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 95% -10%, rgba(46, 169, 126, 0.2), transparent 65%),
    radial-gradient(900px 500px at 5% 110%, rgba(70, 110, 167, 0.18), transparent 60%),
    linear-gradient(145deg, var(--bg-a), var(--bg-b));
}

.page {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.card {
  width: min(92vw, 480px);
  border-radius: 24px;
  background: var(--surface);
  backdrop-filter: blur(8px);
  box-shadow:
    0 20px 45px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  padding: clamp(1.3rem, 3vw, 2rem);
}

h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.25rem, 3vw, 1.8rem);
}

.subline {
  margin: 0 0 1.1rem;
  color: var(--muted);
}

label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
  color: var(--muted);
}

input {
  width: 100%;
  border: 1px solid rgba(230, 237, 243, 0.14);
  border-radius: 12px;
  padding: 0.8rem 0.95rem;
  margin-bottom: 0.9rem;
  font: inherit;
  color: var(--ink);
  background: rgba(13, 17, 23, 0.9);
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

textarea {
  width: 100%;
  border: 1px solid rgba(230, 237, 243, 0.14);
  border-radius: 12px;
  padding: 0.8rem 0.95rem;
  margin-bottom: 0.9rem;
  font: inherit;
  color: var(--ink);
  background: rgba(13, 17, 23, 0.9);
  outline: none;
  resize: vertical;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--ring);
}

.button {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 0.72rem 1rem;
  font: inherit;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  text-align: center;
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  cursor: pointer;
}

.button.secondary {
  margin-top: 0.65rem;
  background: transparent;
  border: 1px solid rgba(230, 237, 243, 0.2);
}

.error {
  margin: 0 0 1rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.35);
  color: var(--danger);
  font-size: 0.92rem;
}

.notice {
  margin: 0 0 1rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: rgba(46, 169, 126, 0.12);
  border: 1px solid rgba(46, 169, 126, 0.4);
  color: #86dcbc;
  font-size: 0.92rem;
}

.top-right {
  position: fixed;
  top: 1.1rem;
  right: 1rem;
}

.meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem clamp(1rem, 3vw, 2rem);
}

.brand {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fefefe;
}

.game-wrap {
  width: min(1100px, 94vw);
  margin: 0 auto 2rem;
  display: grid;
  gap: 1rem;
}

.hero {
  padding: 1.2rem 1.2rem 1rem;
  border-radius: 20px;
  background: linear-gradient(120deg, rgba(255, 78, 80, 0.2), rgba(67, 134, 252, 0.2));
  border: 1px solid rgba(230, 237, 243, 0.12);
}

.hero p {
  margin: 0.4rem 0 0;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.tile {
  border-radius: 18px;
  padding: 1rem;
  min-height: 180px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.26);
  transform: translateY(10px);
  opacity: 0;
  animation: tileIn 420ms ease-out forwards;
}

.tile h2 {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
}

.tile p {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
}

.tile-link {
  margin-top: 1rem;
  align-self: flex-start;
  text-decoration: none;
  color: #111;
  background: rgba(255, 255, 255, 0.92);
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
}

.tile.red {
  background: linear-gradient(150deg, #ff4e50, #f14567);
  animation-delay: 70ms;
}

.tile.blue {
  background: linear-gradient(150deg, #4386fc, #2f62d6);
  animation-delay: 130ms;
}

.tile.yellow {
  background: linear-gradient(150deg, #f6b93b, #d89d2a);
  animation-delay: 180ms;
}

.tile.green {
  background: linear-gradient(150deg, #27ae60, #1f8e4f);
  animation-delay: 230ms;
}

.pin-panel {
  border-radius: 18px;
  padding: 1rem 1.2rem;
  border: 1px solid rgba(230, 237, 243, 0.12);
  background: rgba(22, 27, 34, 0.88);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.pin-panel h3 {
  margin: 0;
  font-size: 1rem;
}

.pin-box {
  font-weight: 700;
  letter-spacing: 0.18em;
  border-radius: 14px;
  padding: 0.65rem 0.95rem;
  border: 1px solid rgba(230, 237, 243, 0.2);
  background: rgba(13, 17, 23, 0.95);
}

.profile-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.4rem;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.page-top {
  align-items: start;
}

.wide-card {
  width: min(92vw, 860px);
}

.stack-list {
  display: grid;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.stack-item {
  border: 1px solid rgba(230, 237, 243, 0.12);
  border-radius: 14px;
  padding: 0.85rem;
  background: rgba(13, 17, 23, 0.55);
}

.stack-item h2 {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
}

.stack-item p {
  margin: 0 0 0.45rem;
  color: var(--muted);
}

.stack-item small {
  color: var(--muted);
}

@keyframes tileIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 480px) {
  .top-right {
    right: 0.8rem;
    top: 0.8rem;
  }

  .game-grid {
    grid-template-columns: 1fr;
  }

  .pin-panel {
    flex-direction: column;
    align-items: flex-start;
  }
}
