/* Samuel的AI遊戲庫 — 樣式 */

:root {
  --bg:        #0d1117;
  --bg-soft:   #161b22;
  --card:      #1c2333;
  --card-2:    #232b3d;
  --line:      #2c3549;
  --fg:        #e6edf3;
  --fg-dim:    #9aa7bd;
  --accent:    #7c5cff;
  --accent-2:  #22d3ee;
  --ok:        #34d399;
  --err:       #f87171;
  --radius:    14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Helvetica Neue",
               "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .9em;
  background: #0b0f17;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
}

/* ---------------------------------------------------------------- hero */

.hero {
  background:
    radial-gradient(900px 380px at 12% -10%, rgba(124, 92, 255, .30), transparent 62%),
    radial-gradient(700px 320px at 88% 0%, rgba(34, 211, 238, .20), transparent 60%),
    linear-gradient(180deg, #121826 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
  padding: 52px 20px 44px;
}

.hero-inner {
  max-width: 1040px;
  margin: 0 auto;
  text-align: center;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 5.2vw, 46px);
  letter-spacing: .5px;
  background: linear-gradient(100deg, #fff 10%, #b9a9ff 52%, #7ee9f5 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  margin: 0 0 22px;
  color: var(--fg-dim);
  font-size: 15px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
}

.inline-form { display: inline; margin: 0; }

/* ---------------------------------------------------------------- wrap */

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 30px 20px 60px;
}
.wrap.narrow { max-width: 720px; }

/* ---------------------------------------------------------------- card */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-bottom: 22px;
}

.card h2 {
  margin: 0 0 10px;
  font-size: 19px;
}

.setup-card { max-width: 520px; margin-inline: auto; }

.empty { text-align: center; }
.empty .big { font-size: 20px; margin: 0 0 6px; }

/* ---------------------------------------------------------------- form */

.stack { display: grid; gap: 14px; margin-top: 16px; }

label {
  display: grid;
  gap: 7px;
  font-size: 14px;
  color: var(--fg-dim);
}

input[type="password"],
input[type="file"] {
  width: 100%;
  padding: 11px 13px;
  background: #0b0f17;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--fg);
  font-size: 15px;
  font-family: inherit;
}
input[type="file"] { padding: 9px 11px; cursor: pointer; }
input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, .20);
}

/* ---------------------------------------------------------------- btn */

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease, background .12s ease;
}
.btn:hover { text-decoration: none; filter: brightness(1.10); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn.primary {
  background: linear-gradient(135deg, var(--accent), #4d7cff);
  color: #fff;
}
.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--fg-dim);
}
.btn.ghost:hover { color: var(--fg); border-color: var(--accent); }
.btn.wide { width: 100%; }

/* ---------------------------------------------------------------- badge */

.badge {
  display: inline-block;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid var(--line);
  color: var(--fg-dim);
}
.badge.ok    { color: var(--ok);   border-color: rgba(52, 211, 153, .42); background: rgba(52, 211, 153, .10); }
.badge.setup { color: #fbbf24;      border-color: rgba(251, 191, 36, .42); background: rgba(251, 191, 36, .10); }

/* ---------------------------------------------------------------- alert */

.alert {
  padding: 12px 16px;
  border-radius: 11px;
  margin-bottom: 16px;
  font-size: 14.5px;
  border: 1px solid;
}
.alert.info { background: rgba(34, 211, 238, .09); border-color: rgba(34, 211, 238, .34); color: #a5eefc; }
.alert.ok   { background: rgba(52, 211, 153, .09); border-color: rgba(52, 211, 153, .34); color: #a7f3d0; }
.alert.error{ background: rgba(248, 113, 113, .09); border-color: rgba(248, 113, 113, .34); color: #fca5a5; }

/* ---------------------------------------------------------------- games */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}
.section-head h2 { margin: 0; font-size: 19px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 16px;
}

.game {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--fg);
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.game:hover {
  text-decoration: none;
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .42);
}

.game-thumb {
  height: 118px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, #232b3d 0%, #171d2b 100%);
  border-bottom: 1px solid var(--line);
}
.game-initial {
  font-size: 42px;
  font-weight: 700;
  color: transparent;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
}

.game-body { padding: 13px 15px 15px; }
.game-body h3 {
  margin: 0 0 5px;
  font-size: 15.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- list */

.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.plain-list li {
  padding: 11px 14px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14.5px;
}

/* ---------------------------------------------------------------- misc */

.muted { color: var(--fg-dim); }
.small { font-size: 12.5px; }

.foot {
  text-align: center;
  padding: 26px 20px 0;
  border-top: 1px solid var(--line);
  margin-top: 26px;
}
.foot p { margin: 0; }

@media (max-width: 560px) {
  .hero { padding: 38px 16px 32px; }
  .wrap { padding: 22px 14px 44px; }
  .card { padding: 20px 17px; }
}