/* 纸牌接龙 —— 样式 */
:root{
  --bg:#0f172a;
  --panel:#1e293b;
  --felt:#14532d;
  --text:#f1f5f9;
  --muted:#94a3b8;
  --accent:#38bdf8;
  --red:#dc2626;
  --black:#000000;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  line-height:1.5;
}
a { color:var(--accent); text-decoration:underline; text-decoration-thickness:2px; text-underline-offset:3px; }
a:focus-visible { outline:3px solid var(--accent); outline-offset:3px; }

.skip-link {
  position:absolute; left:-9999px; top:auto; width:1px; height:1px; overflow:hidden;
}
.skip-link:focus { position:static; width:auto; height:auto; padding:1rem; background:#000; color:#fff; }

.site-header { background:var(--panel); border-bottom:1px solid #334155; padding:0.75rem 0; }
.header-inner { max-width:1000px; margin:0 auto; padding:0 1rem; display:flex; align-items:center; gap:1rem; flex-wrap:wrap; }
.brand { color:var(--text); text-decoration:none; font-weight:800; font-size:1.25rem; letter-spacing:0.05em; }
.main-nav { margin-left:auto; }
.nav-list { display:flex; gap:0.75rem; list-style:none; margin:0; padding:0; }
.nav-link { color:var(--muted); text-decoration:none; padding:0.4rem 0.75rem; border-radius:6px; }
.nav-link:hover, .nav-link:focus-visible { background:#334155; color:var(--text); }

.container { max-width:1000px; margin:0 auto; padding:0 1rem; }

.hero { padding:2.5rem 0; background:linear-gradient(180deg,#0f172a,#0b1021); }
.hero-grid { display:flex; flex-direction:column; gap:2rem; align-items:center; text-align:center; }
@media (min-width:768px){ .hero-grid{ flex-direction:row; text-align:left; align-items:center; } }
.eyebrow { color:var(--accent); font-size:0.9rem; text-transform:uppercase; letter-spacing:0.1em; margin:0 0 0.5rem; display:flex; align-items:center; justify-content:center; gap:0.5rem; }
@media (min-width:768px){ .eyebrow{ justify-content:flex-start; } }
.hero h1 { font-size:clamp(2rem,5vw,3rem); margin:0 0 1rem; line-height:1.1; }
.hero-lede { color:var(--muted); font-size:1.05rem; max-width:62ch; margin:0 0 1.5rem; }
.hero-actions { display:flex; gap:0.75rem; flex-wrap:wrap; justify-content:center; }
@media (min-width:768px){ .hero-actions{ justify-content:flex-start; } }
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:0.4rem;
  padding:0.6rem 1.2rem; border:1px solid transparent; border-radius:8px; font-weight:700;
  font-size:1rem; cursor:pointer; text-decoration:none; transition:transform .1s, background .2s;
}
.btn:active { transform:scale(0.97); }
.btn:focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
.btn-primary { background:var(--accent); color:#000; border-color:var(--accent); }
.btn-primary:hover { background:#7dd3fc; }
.btn-secondary { background:transparent; color:var(--text); border:1px solid #475569; }
.btn-secondary:hover { background:#334155; }
.btn-outline { background:transparent; color:var(--text); border:1px solid #475569; padding:0.45rem 1rem; font-size:0.95rem; }
.btn-outline:hover { background:#334155; }

.section { padding:2rem 0; }
.game-header { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:0.75rem; margin-bottom:1.25rem; }
.game-header h2 { margin:0; font-size:1.5rem; }
.game-controls { display:flex; gap:0.5rem; flex-wrap:wrap; }

.solitaire-board {
  display:grid;
  grid-template-rows: auto auto 1fr;
  gap:1rem;
  padding:1rem 0;
}
.board-stock { display:flex; gap:1rem; align-items:flex-start; }
.stock-pile, .waste-pile {
  width:80px; height:112px; border-radius:8px; border:2px solid #334155;
  background:#475569; display:flex; align-items:center; justify-content:center;
  font-weight:800; font-size:1.1rem; cursor:pointer; user-select:none; touch-action:none;
}
.stock-pile:empty { opacity:0.5; cursor:default; }
.waste-pile { overflow:hidden; position:relative; }
.waste-top { position:absolute; top:0; left:0; width:80px; height:112px; border-radius:8px; border:2px solid var(--accent); box-sizing:border-box; }
.board-foundations { display:flex; gap:0.75rem; justify-content:center; }
.foundation-slot {
  width:80px; height:112px; border-radius:8px; border:2px dashed #334155;
  background:#0f172a; display:flex; align-items:center; justify-content:center; color:#334155;
  font-size:0.9rem; touch-action:none;
}
.foundation-slot.has-card { border-style:solid; border-color:#475569; color:var(--text); }
.board-tableau {
  display:flex; gap:0.75rem; overflow-x:auto; padding-bottom:0.5rem; scrollbar-width:none;
}
.board-tableau::-webkit-scrollbar { display:none; }
.tableau-col {
  min-width:80px; max-width:100px; display:flex; flex-direction:column; gap:0.18rem;
  padding-bottom:1.2rem; /* 留出底部牌的可见空间 */
}

/* 卡牌 */
.card {
  width:80px; height:112px; border-radius:8px; border:1.5px solid #cbd5e1;
  background:#ffffff; display:flex; flex-direction:column; padding:6px 5px 4px;
  font-weight:800; font-size:1.35rem; line-height:1; user-select:none; touch-action:none;
  position:relative; box-shadow:0 2px 6px rgba(0,0,0,0.25);
}
.card.red { color:#dc2626; }
.card.black { color:#000000; }
.card .rank { font-size:1.5rem; font-weight:900; }
.card .suit { font-size:1rem; }
.card.face-down {
  background:linear-gradient(135deg,#475569,#334155);
  border-color:#334155; color:transparent; display:flex; align-items:center; justify-content:center;
}
.card.face-down::after { content:""; width:100%; height:100%; border-radius:6px; background:repeating-linear-gradient(45deg,#64748b,#64748b 4px,#475569 4px,#475569 8px); opacity:0.9; }
.card.selected { outline:3px solid var(--accent); outline-offset:2px; z-index:10; }
.card.dragging { opacity:0.85; box-shadow:0 8px 24px rgba(0,0,0,0.35); cursor:grabbing; }
.card.drop-target { border-color:var(--accent); background:rgba(56,189,248,0.12); }

.card-stack { position:relative; }
.card-stack .card { position:absolute; left:0; top:0; z-index:1; transition:transform .12s ease; }
.card-stack .card.face-down { z-index:0; }

.game-status {
  margin-top:1rem; padding:0.75rem 1rem; background:var(--panel); border-radius:8px;
  border:1px solid #334155; font-size:0.95rem; color:var(--muted);
}
.game-status strong { color:var(--text); }
#message { margin-top:0.5rem; min-height:1.3rem; color:var(--accent); font-weight:700; }

#how-to-play { margin-top:1.5rem; }
#how-to-play h3 { margin-top:0; font-size:1.1rem; color:var(--accent); }
#how-to-play ul { color:var(--muted); padding-left:1.2rem; }
#how-to-play li { margin:0.35rem 0; }

.site-footer { margin-top:3rem; padding:1.5rem 0; border-top:1px solid #334155; color:var(--muted); font-size:0.9rem; text-align:center; }
.site-footer a { color:var(--accent); }

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce){
  * { animation:none !important; transition:none !important; scroll-behavior:auto !important; }
}
