/* ================================================================
   Lorcana 入賞デッキまとめ — Modern Minimal v2
   Primary: Lorcana Indigo #373b70
   Accent:  Illuminary Gold #d3ba84
   ================================================================ */

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --indigo:       #373b70;
  --indigo-dark:  #272a52;
  --indigo-mid:   #3e4380;
  --indigo-light: #545aaa;
  --gold:         #d3ba84;
  --gold-light:   #ead9b0;
  --gold-dark:    #a8905a;

  --bg:           #f5f5fb;
  --surface:      #ffffff;
  --surface-2:    #f0f0f8;
  --text:         #181828;
  --text-2:       #4a4a6a;
  --text-muted:   #7878a0;
  --border:       #e4e4f0;
  --border-2:     #cecee8;

  --shadow-xs: 0 1px 3px rgba(30,30,80,.07);
  --shadow-sm: 0 2px 10px rgba(30,30,80,.09);
  --shadow-md: 0 6px 24px rgba(30,30,80,.13);
  --shadow-lg: 0 16px 56px rgba(30,30,80,.18);

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans JP',
               'Hiragino Sans', 'Yu Gothic', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--indigo); text-decoration: none; }
a:hover { color: var(--indigo-light); }
img { max-width: 100%; display: block; }

/* ── Header ─────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--indigo);
  box-shadow: 0 2px 16px rgba(20,20,60,.22);
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-logo {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: .04em;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.site-logo .site-name {
  color: rgba(255,255,255,.85);
  font-weight: 400;
  font-size: .9rem;
}
.header-nav { display: flex; align-items: center; gap: .2rem; }
.header-nav a {
  color: rgba(255,255,255,.65);
  font-size: .875rem;
  padding: .4rem .85rem;
  border-radius: var(--r-sm);
  transition: background .15s, color .15s;
}
.header-nav a:hover { background: rgba(255,255,255,.12); color: #fff; }

/* ── Main Wrapper ────────────────────────────────────────────── */
.main-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

/* ── Page Hero ──────────────────────────────────────────────── */
.page-hero { margin-bottom: 2rem; }
.page-hero h1 {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--indigo);
  letter-spacing: -.02em;
  line-height: 1.25;
}
.page-hero p {
  color: var(--text-muted);
  font-size: .9rem;
  margin-top: .35rem;
}

/* ── Filter Bar ─────────────────────────────────────────────── */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: flex-end;
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  flex: 1;
  min-width: 180px;
}
.filter-group label {
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .07em;
}
.filter-group input[type="text"],
.filter-group select {
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: .55rem .85rem;
  font-size: .9rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}
.filter-group input[type="text"]:focus,
.filter-group select:focus {
  border-color: var(--indigo-light);
  box-shadow: 0 0 0 3px rgba(55,59,112,.1);
}
.filter-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237878a0' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  padding-right: 2.25rem;
  cursor: pointer;
}
.filter-actions { display: flex; gap: .5rem; align-self: flex-end; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-primary {
  background: var(--indigo);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  padding: .575rem 1.3rem;
  font-size: .9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
  line-height: 1.4;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.btn-primary:hover { background: var(--indigo-mid); color: #fff; }

.btn-reset {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: .525rem 1rem;
  font-size: .875rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s, color .15s;
  white-space: nowrap;
  line-height: 1.4;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.btn-reset:hover { border-color: var(--indigo); color: var(--indigo); }

/* ── Results Meta ────────────────────────────────────────────── */
.results-meta { display: flex; align-items: center; margin-bottom: 1.25rem; }
.results-count { font-size: .83rem; color: var(--text-muted); }
.results-count strong { color: var(--text-2); font-weight: 600; }

/* ── Deck Grid ──────────────────────────────────────────────── */
.deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

/* ── Deck Card ──────────────────────────────────────────────── */
.deck-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s cubic-bezier(.3,.7,.2,1), box-shadow .2s, border-color .2s;
  display: flex;
  flex-direction: column;
}
.deck-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-2);
}

.card-image {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(140deg, var(--indigo) 0%, var(--indigo-dark) 100%);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s cubic-bezier(.3,.7,.2,1);
}
.deck-card:hover .card-image img { transform: scale(1.05); }
.card-image .no-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.12);
  font-size: 3.5rem;
}

.placement-badge {
  position: absolute;
  top: .65rem;
  left: .65rem;
  background: var(--gold);
  color: var(--indigo-dark);
  font-size: .76rem;
  font-weight: 800;
  padding: .22rem .7rem;
  border-radius: 999px;
  line-height: 1.5;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  letter-spacing: .02em;
}

.card-body {
  padding: 1rem 1.15rem 1.1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .45rem;
}
.card-player {
  font-weight: 700;
  font-size: .97rem;
  color: var(--text);
  line-height: 1.3;
}
.card-ink-group { display: flex; gap: .2rem; flex-wrap: wrap; flex-shrink: 0; padding-top: .1rem; }

.card-tournament {
  font-size: .78rem;
  color: var(--text-muted);
  margin-bottom: .5rem;
  display: flex;
  align-items: center;
  gap: .35rem;
}
.card-tournament svg { flex-shrink: 0; opacity: .5; }

.card-deck-type {
  display: inline-block;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .73rem;
  padding: .15rem .55rem;
  color: var(--text-2);
  margin-bottom: .6rem;
}

.card-footer {
  margin-top: auto;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}
.btn-detail {
  font-size: .8rem;
  color: var(--text-muted);
  font-weight: 600;
  padding: .3rem .7rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  transition: all .15s;
  background: transparent;
}
.deck-card:hover .btn-detail {
  border-color: var(--indigo);
  color: var(--indigo);
  background: var(--surface-2);
}

/* ── Ink Badges ─────────────────────────────────────────────── */
.ink-badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .18rem .55rem;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 600;
  line-height: 1;
}
.ink-Amber    { background: #fdf0d5; color: #a06000; }
.ink-Amethyst { background: #f0e8fc; color: #6a2da0; }
.ink-Emerald  { background: #e4f8ee; color: #1a7a3c; }
.ink-Ruby     { background: #fde8e8; color: #b01c1c; }
.ink-Sapphire { background: #e4eeff; color: #1a3fa0; }
.ink-Steel    { background: #ebebeb; color: #44446a; }

.ink-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-Amber    { background: #f5a623; }
.dot-Amethyst { background: #9b59b6; }
.dot-Emerald  { background: #27ae60; }
.dot-Ruby     { background: #e74c3c; }
.dot-Sapphire { background: #2980b9; }
.dot-Steel    { background: #95a5a6; }

/* ── Empty State ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 2.25rem; margin-bottom: 1rem; opacity: .35; display: block; }
.empty-state p { font-size: .92rem; line-height: 1.8; }

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-size: .8rem;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,15,45,.6);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--r-lg);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn .22s cubic-bezier(.3,.7,.2,1);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  background: var(--indigo);
  color: #fff;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  position: sticky;
  top: 0;
  z-index: 1;
}
.modal-header h2 { font-size: 1.02rem; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  color: rgba(255,255,255,.55);
  font-size: 1.25rem;
  cursor: pointer;
  padding: .1rem .35rem;
  border-radius: 5px;
  transition: color .15s, background .15s;
  line-height: 1;
}
.modal-close:hover { color: #fff; background: rgba(255,255,255,.1); }

.modal-body { padding: 1.5rem; }
.modal-deck-image {
  width: 100%;
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.modal-deck-image img { width: 100%; }

.modal-info { display: grid; gap: 0; }
.modal-info-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: .3rem;
  align-items: start;
  padding: .65rem 0;
  border-bottom: 1px solid var(--border);
}
.modal-info-row:last-child { border-bottom: none; }
.modal-label {
  font-size: .71rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  padding-top: .1rem;
}
.modal-value { font-size: .92rem; color: var(--text); }
.modal-decklist {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 1rem 1.1rem;
  font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', monospace;
  font-size: .82rem;
  white-space: pre-wrap;
  max-height: 300px;
  overflow-y: auto;
  line-height: 1.85;
  color: var(--text);
  margin-top: .4rem;
}

/* ── Admin: Layout ──────────────────────────────────────────── */
.admin-body { background: var(--bg); }

.admin-header {
  background: var(--indigo-dark);
  box-shadow: 0 1px 10px rgba(0,0,0,.2);
}
.admin-header .header-inner { height: 56px; }
.admin-logo {
  font-size: .95rem;
  font-weight: 700;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: .4rem;
  letter-spacing: .03em;
}
.admin-nav { display: flex; gap: .15rem; }
.admin-nav a {
  color: rgba(255,255,255,.6);
  font-size: .845rem;
  padding: .35rem .9rem;
  border-radius: var(--r-sm);
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.admin-nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.admin-nav a.active { background: rgba(255,255,255,.15); color: #fff; font-weight: 600; }
.admin-nav a.nav-new { background: rgba(211,186,132,.1