/* Solitaire Classic - Casino Felt Stylesheet */

:root {
  --felt-green: #14532d;
  --felt-dark: #052e16;
  --felt-border: #166534;
  --panel-bg: #0f3d1e;

  --card-width: 68px;
  --card-height: 98px;
  --card-radius: 6px;
  --card-bg: #ffffff;
  --card-border: #94a3b8;
  --card-red: #dc2626;
  --card-black: #0f172a;

  --accent: #22c55e;
  --accent-hover: #16a34a;
  --text-main: #f8fafc;
  --text-muted: #86efac;
  --border: #1e3a29;

  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background-color: var(--felt-dark);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

/* Header */
.site-header {
  background-color: rgba(5, 46, 22, 0.95);
  border-bottom: 1px solid var(--felt-border);
  padding: 0.75rem 1.25rem;
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.back-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.15s ease;
  min-height: 44px;
  padding: 0.25rem 0.5rem;
}

.back-link:hover, .back-link:focus-visible {
  color: #ffffff;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.game-icon {
  font-size: 1.5rem;
}

.brand-title {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text-main);
}

.icon-button {
  background: var(--panel-bg);
  border: 1px solid var(--felt-border);
  color: var(--text-main);
  font-size: 1.25rem;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.icon-button:hover, .icon-button:focus-visible {
  background: var(--felt-green);
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Main Container */
.game-container {
  flex: 1;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-header-text {
  text-align: center;
  margin-bottom: 1rem;
}

.game-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.game-subtitle {
  color: var(--text-muted);
  font-size: 0.925rem;
  max-width: 580px;
  margin: 0 auto;
}

/* Controls Toolbar */
.controls-toolbar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.tool-btn {
  background: var(--panel-bg);
  border: 1px solid var(--felt-border);
  color: var(--text-main);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.tool-btn:hover {
  background: var(--felt-green);
}

/* HUD */
.game-hud {
  display: flex;
  gap: 1.5rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--felt-border);
  padding: 0.4rem 1.25rem;
  border-radius: 20px;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

.hud-stat {
  display: flex;
  gap: 0.35rem;
}

.hud-label {
  color: var(--text-muted);
}

/* Felt Tabletop */
.felt-tabletop {
  background: radial-gradient(circle at center, #15803d 0%, #14532d 60%, #052e16 100%);
  border: 4px solid #166534;
  border-radius: 16px;
  padding: 1.25rem 1rem 3rem;
  width: 100%;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6), inset 0 0 40px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  user-select: none;
}

/* Top Row: Stock, Waste, Foundations */
.top-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  gap: 0.5rem;
}

.deck-group, .foundations-group {
  display: flex;
  gap: 0.6rem;
}

/* Card Slots */
.card-slot {
  width: var(--card-width);
  height: var(--card-height);
  border: 2px dashed rgba(255, 255, 255, 0.25);
  border-radius: var(--card-radius);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.foundation-ghost {
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.15);
}

.stock-card-back {
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(45deg, #1e40af, #1e40af 6px, #1d4ed8 6px, #1d4ed8 12px);
  border: 2px solid #ffffff;
  border-radius: var(--card-radius);
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

/* Lower Row: Tableau Cascades */
.tableau-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  gap: 0.5rem;
  min-height: 380px;
}

.tableau-col {
  width: var(--card-width);
  min-height: var(--card-height);
  position: relative;
}

/* Actual Playing Cards */
.card {
  width: var(--card-width);
  height: var(--card-height);
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  position: absolute;
  top: 0;
  left: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 4px;
  font-weight: 800;
  line-height: 1;
  transition: transform 0.1s ease;
  touch-action: manipulation;
}

.card.red {
  color: var(--card-red);
}

.card.black {
  color: var(--card-black);
}

.card.face-down {
  background: repeating-linear-gradient(45deg, #1e40af, #1e40af 6px, #1d4ed8 6px, #1d4ed8 12px);
  border: 2px solid #ffffff;
  color: transparent;
  cursor: default;
}

.card-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-size: 0.85rem;
}

.card-center-suit {
  align-self: center;
  font-size: 1.5rem;
  opacity: 0.9;
}

.card-bottom {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 0.85rem;
  transform: rotate(180deg);
}

/* Victory Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
  backdrop-filter: blur(4px);
}

.modal-card {
  background: #0f3d1e;
  border: 2px solid var(--accent);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  animation: modal-enter 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-enter {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-badge {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.modal-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.35rem;
}

.modal-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.modal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 0.75rem 0.5rem;
  margin-bottom: 1.25rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-lbl {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.stat-val {
  color: #ffffff;
  font-size: 1.15rem;
}

.btn-primary {
  width: 100%;
  background: var(--accent);
  color: #052e16;
  border: none;
  font-weight: 700;
  font-size: 0.95rem;
  min-height: 46px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

/* SEO Content */
.content-block {
  max-width: 720px;
  width: 100%;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.article-header {
  margin-bottom: 1.5rem;
}

.article-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.35rem;
}

.freshness-tag {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.article-section {
  margin-bottom: 2rem;
}

.article-section h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.85rem;
}

.article-section h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: #e2e8f0;
  margin: 1.25rem 0 0.6rem;
}

.article-section p {
  color: #cbd5e1;
  margin-bottom: 1rem;
  line-height: 1.7;
}

.rules-list {
  padding-left: 1.25rem;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.rules-list strong {
  color: #ffffff;
}

.strategy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}

.strategy-card {
  background: var(--panel-bg);
  border: 1px solid var(--felt-border);
  border-radius: 10px;
  padding: 1.25rem;
}

.strategy-card h4 {
  color: var(--accent);
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.strategy-card p {
  color: #cbd5e1;
  font-size: 0.9rem;
  margin-bottom: 0;
  line-height: 1.6;
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  background: var(--panel-bg);
  border: 1px solid var(--felt-border);
  border-radius: 10px;
  overflow: hidden;
}

.faq-item[open] {
  border-color: var(--accent);
}

.faq-question {
  padding: 1rem 1.25rem;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--accent);
}

.faq-item[open] .faq-question::after {
  content: "−";
}

.faq-answer {
  padding: 0 1.25rem 1.25rem;
  color: #cbd5e1;
  font-size: 0.925rem;
  line-height: 1.6;
}

.cross-links {
  background: var(--panel-bg);
  border: 1px solid var(--felt-border);
  border-radius: 12px;
  padding: 1.5rem;
}

.related-games-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.related-games-list li a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.related-games-list li a:hover {
  text-decoration: underline;
}

/* Footer */
.site-footer {
  background: rgba(5, 46, 22, 0.95);
  border-top: 1px solid var(--felt-border);
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent);
}

/* Responsive scaling for mobile screens */
@media (max-width: 600px) {
  :root {
    --card-width: 44px;
    --card-height: 64px;
  }

  .card-top, .card-bottom {
    font-size: 0.65rem;
  }

  .card-center-suit {
    font-size: 1.1rem;
  }

  .felt-tabletop {
    padding: 0.75rem 0.4rem;
  }
}
