:root {
  --bg-start: #0b0b12;
  --bg-end: #120c0a;
  --accent-1: #ffcc33;
  --accent-2: #ff6a00;
  --accent-3: #ff2e63;
  --border-soft: rgba(255, 255, 255, 0.12);
  --text-main: rgba(255, 255, 255, 0.92);
  --text-muted: rgba(255, 255, 255, 0.7);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background-color: var(--bg-start);
  background:
    radial-gradient(900px 500px at 20% 10%, rgba(255, 106, 0, 0.25), transparent 60%),
    radial-gradient(800px 520px at 80% 15%, rgba(255, 46, 99, 0.18), transparent 60%),
    radial-gradient(900px 600px at 50% 100%, rgba(255, 204, 51, 0.12), transparent 55%),
    linear-gradient(180deg, var(--bg-start), var(--bg-end));
  overscroll-behavior: none;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: calc(24px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom));
  color: var(--text-main);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background-color: var(--bg-start);
  background:
    radial-gradient(900px 500px at 20% 10%, rgba(255, 106, 0, 0.25), transparent 60%),
    radial-gradient(800px 520px at 80% 15%, rgba(255, 46, 99, 0.18), transparent 60%),
    radial-gradient(900px 600px at 50% 100%, rgba(255, 204, 51, 0.12), transparent 55%),
    linear-gradient(180deg, var(--bg-start), var(--bg-end));
  overscroll-behavior: none;
}

.app {
  width: min(760px, 100%);
  text-align: center;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  padding: 22px 18px 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55), 0 0 40px rgba(255, 106, 0, 0.12);
  position: relative;
  overflow: hidden;
}

.app::before {
  content: "";
  position: absolute;
  inset: -2px -2px auto -2px;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2), var(--accent-3), var(--accent-2), var(--accent-1));
  opacity: 0.95;
}

.title {
  margin: 0 0 8px;
  font-size: clamp(26px, 4vw, 36px);
}

.stats {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 6px 12px;
  margin: 0 auto 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text-muted);
  font-size: 13px;
}

.stats b {
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2), var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text {
  margin: 6px 0;
  color: var(--text-muted);
}

.board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.num {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 14px 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.1)),
    radial-gradient(120% 140% at 20% 10%, rgba(255, 204, 51, 0.35), transparent 55%),
    radial-gradient(120% 140% at 80% 20%, rgba(255, 106, 0, 0.3), transparent 60%),
    rgba(0, 0, 0, 0.22);
  color: var(--text-main);
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  user-select: none;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
  transition: transform 0.08s ease, box-shadow 0.15s ease, border-color 0.15s ease, filter 0.15s ease;
}

.num:hover {
  border-color: rgba(255, 204, 51, 0.45);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.42), 0 0 18px rgba(255, 106, 0, 0.25);
  filter: saturate(1.08);
  transform: translateY(-1px);
}

.num:focus-visible,
.btn:focus-visible {
  outline: 2px solid rgba(255, 204, 51, 0.55);
  outline-offset: 2px;
}

.num:active {
  transform: translateY(1px) scale(0.99);
}

.num:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.2);
  transform: none;
  box-shadow: none;
}

.panel {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.2);
  display: grid;
  gap: 8px;
}

.msg {
  margin: 0;
  color: var(--text-main);
  font-weight: 600;
}

.hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.08s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  border-color: rgba(255, 106, 0, 0.45);
  box-shadow: 0 0 18px rgba(255, 106, 0, 0.18);
  transform: translateY(-1px);
}

.footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
}

.footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 1px;
  opacity: 0.9;
  background: linear-gradient(90deg, transparent, rgba(255, 204, 51, 0.55), rgba(255, 106, 0, 0.55), rgba(255, 46, 99, 0.55), transparent);
}

.credit {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 13px;
}

.label {
  opacity: 0.8;
}

.author {
  font-weight: 700;
  letter-spacing: 0.2px;
  text-decoration: none;
  position: relative;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2), var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.author:hover {
  filter: drop-shadow(0 0 10px rgba(255, 106, 0, 0.25));
}

.dot {
  opacity: 0.55;
}

.year {
  opacity: 0.75;
}

.repo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-main);
  text-decoration: none;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.repo:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 204, 51, 0.35);
  background: rgba(0, 0, 0, 0.26);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 24px rgba(255, 106, 0, 0.1);
}

.repo:focus-visible {
  outline: 2px solid rgba(255, 204, 51, 0.55);
  outline-offset: 2px;
}

.icon {
  width: 16px;
  height: 16px;
  display: block;
  opacity: 0.92;
}

@media (max-width: 520px) {
  .board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .num {
    padding: 13px 10px;
  }

  .board .num:last-child {
    grid-column: 2;
  }

  .footer {
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
