/* ATONgames.com — shared styles */

:root {
  --bg: #fffdf8;
  --ink: #1d1b16;
  --muted: #6d675c;
  --line: #ebe4d6;
  --card: #ffffff;
  --soft: #f6f1e6;
  --accent: #ffd23f;
  --good: #1f9d55;
  --bad: #e5484d;
  --radius: 20px;
  --shadow: 0 1px 0 rgba(29, 27, 22, .04), 0 12px 32px -16px rgba(29, 27, 22, .25);
  --font-display: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-quote: 'Fraunces', Georgia, 'Times New Roman', serif;

  --t-common: #8a8f98;
  --t-uncommon: #1f9d55;
  --t-rare: #2f7cf6;
  --t-epic: #9b51e0;
  --t-legendary: #f28c18;
  --t-mythic: #e0357a;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------ logo */

.logo {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 8vw, 4.4rem);
  letter-spacing: -.02em;
  text-decoration: none;
  line-height: 1;
}
.logo .l { display: inline-block; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1), color .2s; }
.logo:hover .l { transform: translateY(-6px) rotate(-4deg); }
.logo:hover .l:nth-child(even) { transform: translateY(-3px) rotate(5deg); }
.logo .l:nth-child(1) { transition-delay: 0s; }
.logo .l:nth-child(2) { transition-delay: .02s; }
.logo .l:nth-child(3) { transition-delay: .04s; }
.logo .l:nth-child(4) { transition-delay: .06s; }
.logo .l:nth-child(5) { transition-delay: .08s; }
.logo .l:nth-child(6) { transition-delay: .10s; }
.logo .l:nth-child(7) { transition-delay: .12s; }
.logo .l:nth-child(8) { transition-delay: .14s; }
.logo .l:nth-child(9) { transition-delay: .16s; }
.logo .dotcom { color: var(--muted); font-weight: 500; }

/* ------------------------------------------------------------ home */

.home-header {
  text-align: center;
  padding: 72px 20px 28px;
}
.tagline {
  margin: 18px auto 0;
  max-width: 34ch;
  color: var(--muted);
  font-size: 1.15rem;
}

.games {
  width: 100%;
  max-width: 1120px;
  margin: 24px auto 0;
  padding: 0 20px 64px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 36px 28px;
}
.game-card {
  display: block;
  text-decoration: none;
  color: inherit;
  outline: none;
}
.game-card .thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 22px;
  overflow: hidden;
  background: var(--c, #eee);
  box-shadow: inset 0 -7px 0 rgba(0, 0, 0, .07);
  transition: transform .3s cubic-bezier(.25, 1.5, .5, 1), box-shadow .3s;
}
.game-card .thumb svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.game-card:hover .thumb,
.game-card:focus-visible .thumb {
  transform: translateY(-6px) rotate(-1.2deg);
  box-shadow: inset 0 -7px 0 rgba(0, 0, 0, .07), 0 18px 30px -18px rgba(0, 0, 0, .45);
}
.game-card:focus-visible .thumb { outline: 3px solid var(--ink); outline-offset: 4px; }
.game-card h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.45rem;
  margin: 14px 4px 2px;
  line-height: 1.2;
}
.game-card p { margin: 0 4px; color: var(--muted); }
.game-card .new-tag {
  display: inline-block;
  vertical-align: middle;
  margin-left: 6px;
  padding: 2px 8px 3px;
  font: 600 .72rem/1.2 var(--font-display);
  letter-spacing: .04em;
  text-transform: uppercase;
  border-radius: 99px;
  background: var(--ink);
  color: #fff;
}
.game-card.soon { cursor: default; }
.game-card.soon .thumb {
  background: transparent;
  border: 3px dashed var(--line);
  box-shadow: none;
  display: grid;
  place-items: center;
  font: 700 4rem/1 var(--font-display);
  color: var(--line);
}
.game-card.soon:hover .thumb { transform: none; }

/* thumbnail animations (play on hover) */
.game-card .bob { transform-box: fill-box; transform-origin: center; }
.game-card:hover .bob { animation: bob 1.2s ease-in-out infinite; }
.game-card:hover .spin { animation: wiggle .8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes bob { 50% { transform: translateY(-10px); } }
@keyframes wiggle { 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }

/* ------------------------------------------------------------ game pages */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
}
.mini-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  text-decoration: none;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.mini-logo span { color: var(--muted); font-weight: 500; }
.mini-logo:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

.account { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; font-weight: 700; }
.account .who { font-family: var(--font-display); font-weight: 600; }

.page {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 12px 20px 64px;
  flex: 1;
}
.page-wide { max-width: 1040px; }

.game-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 9vw, 4rem);
  line-height: 1.05;
  text-align: center;
  margin: 20px 0 8px;
  letter-spacing: -.02em;
}
.game-sub {
  text-align: center;
  color: var(--muted);
  font-size: 1.15rem;
  margin: 0 auto 28px;
  max-width: 40ch;
}

.card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
}

.fine { color: var(--muted); font-size: .92rem; text-align: center; }
.muted { color: var(--muted); font-weight: 600; }

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
  padding: 28px 20px 36px;
}
.site-footer a { color: var(--muted); }

/* ------------------------------------------------------------ controls */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1;
  padding: 13px 22px 14px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 4px 0 var(--ink);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .08s ease, box-shadow .08s ease, background .15s;
  user-select: none;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--ink); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: 0 4px 0 var(--ink); }
.btn-primary { background: var(--accent); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-good { background: #7ee2a8; }
.btn-danger { background: #ffb4b4; }
.btn-xl { font-size: 1.35rem; padding: 17px 34px 18px; }
.btn-small { font-size: .9rem; padding: 8px 14px 9px; box-shadow: 0 3px 0 var(--ink); }
.btn-small:hover { box-shadow: 0 4px 0 var(--ink); }
.btn-small:active { box-shadow: 0 0 0 var(--ink); transform: translateY(3px); }
.btn-block { width: 100%; }

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  font-weight: 700;
}
.link-btn:hover { color: var(--ink); }

.input {
  width: 100%;
  font: 600 1.05rem/1.3 var(--font-body);
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 13px 16px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 45%, transparent); }
.input::placeholder { color: #b3ab9c; font-weight: 600; }
.input-xl { font-size: 1.4rem; padding: 18px 20px; border-radius: 18px; }

.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0 0 18px;
}
.tab {
  font: 600 1rem/1 var(--font-display);
  padding: 10px 16px 11px;
  border-radius: 999px;
  border: 2px solid transparent;
  background: var(--soft);
  cursor: pointer;
  color: var(--muted);
}
.tab:hover { color: var(--ink); }
.tab.active { background: var(--ink); color: #fff; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 28px 12px;
}
.loading { text-align: center; color: var(--muted); padding: 28px 0; }
.loading::after { content: ''; display: inline-block; width: 1em; text-align: left; animation: dots 1s steps(4) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

/* ------------------------------------------------------------ toast, banner, modal */

.toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 100;
  pointer-events: none;
  width: calc(100% - 32px);
}
.toast {
  pointer-events: auto;
  max-width: 480px;
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  border-radius: 14px;
  font-weight: 700;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5);
  animation: toast-in .25s cubic-bezier(.3, 1.5, .5, 1);
}
.toast.bad { background: var(--bad); }
.toast.good { background: var(--good); }
.toast.out { opacity: 0; transform: translateY(8px); transition: .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.96); } }

.banner {
  background: #fff4d6;
  border: 2px solid #f0c55a;
  border-radius: 16px;
  padding: 16px 18px;
  margin: 0 0 24px;
  font-weight: 600;
}
.banner code {
  background: #fff;
  border: 1px solid #f0c55a;
  border-radius: 6px;
  padding: 1px 6px;
  font-size: .92em;
}

.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(29, 27, 22, .45);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 90;
  animation: fade .15s ease;
}
.modal {
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: #fff;
  border-radius: 24px;
  padding: 28px 24px 24px;
  border: 2px solid var(--ink);
  box-shadow: 0 8px 0 var(--ink);
  position: relative;
  animation: pop .22s cubic-bezier(.3, 1.5, .5, 1);
}
.modal-wide { max-width: 860px; }
.modal h2 { font-family: var(--font-display); font-weight: 700; margin: 0 0 6px; font-size: 1.7rem; line-height: 1.15; }
.modal p { margin: 0 0 16px; color: var(--muted); }
.modal .close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: var(--soft);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}
.modal .close:hover { background: var(--line); }
.modal form { display: grid; gap: 12px; }
.modal .switch { text-align: center; margin: 14px 0 0; color: var(--muted); }
.modal .error { color: var(--bad); font-weight: 700; min-height: 1.4em; margin: 0; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(8px); } }

/* confetti */
.confetti {
  position: fixed;
  top: 0;
  left: 0;
  width: 10px;
  height: 14px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 120;
}

/* ------------------------------------------------------------ rarity tiers */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: 600 .78rem/1 var(--font-display);
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 5px 10px 6px;
  border-radius: 99px;
  color: #fff;
  background: var(--tc, var(--t-common));
  white-space: nowrap;
}
.tier-common { --tc: var(--t-common); }
.tier-uncommon { --tc: var(--t-uncommon); }
.tier-rare { --tc: var(--t-rare); }
.tier-epic { --tc: var(--t-epic); }
.tier-legendary { --tc: var(--t-legendary); }
.tier-mythic { --tc: var(--t-mythic); }
.badge.tier-mythic {
  background: linear-gradient(90deg, #ff4f8b, #a45cff, #36c5f0, #ff4f8b);
  background-size: 300% 100%;
  animation: shimmer 3s linear infinite;
}
@keyframes shimmer { to { background-position: 300% 0; } }

/* ------------------------------------------------------------ small screens */

@media (max-width: 560px) {
  body { font-size: 16px; }
  .home-header { padding-top: 48px; }
  .card { padding: 18px; border-radius: 18px; }
  .topbar { padding: 14px 16px; }
  .page { padding: 8px 16px 48px; }
  .games { padding: 0 16px 48px; gap: 28px; }
  .input-xl { font-size: 1.2rem; padding: 15px 16px; }
  .btn-xl { font-size: 1.2rem; padding: 15px 26px 16px; }
}

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