/* ============================================================
   CSS VARIABLES & RESET
   ============================================================ */
:root {
  --bg:          #f5f0e1;
  --board-bg:    #faf3e0;
  --card-bg:     #ffffff;
  --border:      #d4c5a9;
  --brown:       #8b5e3c;
  --brown-dark:  #3e2723;
  --brown-mid:   #8d6e63;
  --brown-soft:  #5a4036;
  --red:         #c0392b;
  --blue:        #2980b9;
  --yellow:      #d4a017;
  --green:       #27ae60;
  --safe-bg:     #faf3e0;
  --shadow-sm:   0 2px 8px rgba(0,0,0,0.08);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.12);
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   18px;
  --transition:  0.18s ease;
  --header-h:    56px;
  --mobile-nav-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue',
               'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--brown-dark);
  font-size: 15px;
  line-height: 1.6;
  font-weight: 500;
  overflow-x: hidden;
}

a { color: var(--brown); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
img, canvas { display: block; max-width: 100%; }
ul { list-style: none; }
table { border-collapse: collapse; }

.skip-link {
  position: absolute; top: -40px; left: 0; z-index: 9999;
  background: var(--brown-dark); color: #fff; padding: 6px 12px;
  border-radius: 0 0 6px 0; font-size: 14px;
}
.skip-link:focus { top: 0; }

/* ============================================================
   LAYOUT
   ============================================================ */
.app { display: flex; flex-direction: column; min-height: 100dvh; }

.first-screen {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  position: relative;
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
  height: var(--header-h);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  box-shadow: var(--shadow-sm);
}

.header-logo { display: flex; align-items: center; gap: 8px; }
.logo-icon {
  width: 32px; height: 32px;
  background: var(--red);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px;
  box-shadow: 0 2px 4px rgba(192,57,43,0.4);
}
.logo-text {
  font-size: 17px; font-weight: 700;
  color: var(--brown-dark);
  display: none;
}
@media (min-width: 640px) { .logo-text { display: block; } }

.header-nav {
  display: none;
  gap: 24px;
  font-size: 14px;
  color: var(--brown-mid);
}
.header-nav a:hover { color: var(--brown); }
@media (min-width: 1024px) { .header-nav { display: flex; } }

.header-title-mobile {
  position: absolute; left: 50%; transform: translateX(-50%);
  font-size: 17px; font-weight: 700; color: var(--brown-dark);
}
@media (min-width: 1024px) { .header-title-mobile { display: none; } }
.header-spacer { width: 32px; }
@media (min-width: 1024px) { .header-spacer { display: none; } }

/* ============================================================
   GAME MAIN
   ============================================================ */
.game-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
}
@media (min-width: 1024px) {
  .game-main { flex-direction: row; }
}

/* Board section */
.board-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  min-height: 0;
}
@media (min-width: 1024px) {
  .board-section { padding: 20px; flex: 0 0 65%; }
}

.canvas-wrapper {
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (min-width: 1024px) {
  .canvas-wrapper { max-width: none; width: 100%; height: 100%; max-height: 560px; }
}

#gameCanvas {
  border-radius: var(--radius-md);
  cursor: pointer;
  touch-action: manipulation;
}

/* Control section */
.control-section {
  flex-shrink: 0;
  padding: 0 12px 8px;
  display: flex;
  flex-direction: column;
}
@media (min-width: 1024px) {
  .control-section {
    flex: 0 0 35%;
    max-width: 380px;
    padding: 20px;
    overflow-y: auto;
    height: 100%;
  }
}

.control-panel {
  background: var(--card-bg);
  border: 1px solid var(--board-bg);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
@media (min-width: 1024px) {
  .control-panel { height: 100%; padding: 18px; gap: 14px; }
}

/* ============================================================
   DIFFICULTY SELECTOR
   ============================================================ */
.diff-selector {
  display: flex;
  background: var(--safe-bg);
  border: 1px solid rgba(212,197,169,0.5);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}
/* Mobile: hide by default, show in settings tab */
@media (max-width: 1023px) { .diff-selector { display: none; } }
@media (max-width: 1023px) { #controlSettingsPanel { display: none; } }

.diff-btn {
  flex: 1;
  padding: 6px 4px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 4px;
  color: var(--brown-mid);
  transition: all var(--transition);
}
.diff-btn.active {
  background: var(--brown);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.diff-btn:hover:not(.active) { color: var(--brown-dark); }

/* ============================================================
   STATUS BOX
   ============================================================ */
.status-box {
  text-align: center;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}
.status-turn {
  font-size: 17px;
  font-weight: 700;
  color: var(--brown-dark);
  min-height: 24px;
}
.status-dice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}
.dice-result {
  font-size: 22px;
  font-weight: 800;
  color: var(--brown-dark);
  min-width: 40px;
  display: inline-block;
}
.dice-result.dice-six { color: var(--red); }

.consecutive-badge {
  background: var(--yellow);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
}
.pieces-home {
  font-size: 12px;
  color: var(--brown-mid);
  margin-top: 4px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ============================================================
   PROBABILITY PANEL
   ============================================================ */
.prob-panel {
  background: var(--safe-bg);
  border: 1px solid rgba(212,197,169,0.4);
  border-radius: var(--radius-sm);
  padding: 12px;
  position: relative;
  overflow: hidden;
}
/* Mobile: hidden by default, show in settings tab */
@media (max-width: 1023px) { .prob-panel { display: none; } }

.prob-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--brown-dark);
  margin-bottom: 8px;
}
.prob-icon { font-size: 15px; }
.prob-best { font-size: 13px; color: rgba(62,39,35,0.85); margin-bottom: 4px; }
.prob-label { color: var(--brown); font-weight: 700; }
.prob-stats { font-size: 12px; color: var(--brown-mid); margin-bottom: 6px; }
.stat-val { font-family: 'Courier New', monospace; font-weight: 700; }
.stat-val.red { color: var(--red); }
.stat-val.green { color: var(--green); }

.move-options { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.move-option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.7);
  border: 1px solid transparent;
}
.move-option.safe  { border-color: rgba(39,174,96,0.3); background: rgba(39,174,96,0.05); }
.move-option.danger { border-color: rgba(192,57,43,0.2); }
.mo-label { flex: 1; color: var(--brown-dark); font-weight: 600; }
.mo-risk { font-size: 11px; font-weight: 700; }
.mo-risk.risk-low { color: var(--green); }
.mo-risk.risk-high { color: var(--red); }
.mo-tag {
  font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 3px;
}
.mo-tag.capture { background: var(--red); color: #fff; }
.mo-tag.jump    { background: var(--yellow); color: #fff; }

/* ============================================================
   ACTION BUTTONS
   ============================================================ */
.action-buttons { display: flex; flex-direction: column; gap: 8px; }

.btn-roll {
  width: 100%;
  padding: 11px;
  background: var(--brown);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 6px rgba(139,94,60,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition);
}
.btn-roll:hover:not(:disabled) { background: #7a5234; transform: translateY(-1px); box-shadow: 0 4px 10px rgba(139,94,60,0.4); }
.btn-roll:active:not(:disabled) { transform: translateY(0); }
.btn-roll:disabled { background: var(--border); color: var(--brown-mid); cursor: not-allowed; box-shadow: none; }
.btn-roll.active { animation: pulse-btn 2s infinite; }
@keyframes pulse-btn {
  0%,100% { box-shadow: 0 2px 6px rgba(139,94,60,0.35); }
  50%      { box-shadow: 0 2px 14px rgba(139,94,60,0.6); }
}

.btn-group {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.btn-secondary {
  padding: 7px 4px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  color: var(--brown-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: all var(--transition);
}
.btn-secondary:hover:not(:disabled) { background: var(--safe-bg); border-color: var(--brown); }
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================================
   SOUND CONTROLS
   ============================================================ */
.sound-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--brown-mid);
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
/* Show on desktop only, mobile uses settings tab */
@media (max-width: 1023px) { .sound-controls { display: none; } }

.sound-controls label { font-weight: 600; flex-shrink: 0; }
.sound-controls select {
  flex: 1;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  background: var(--safe-bg);
  color: var(--brown-dark);
  cursor: pointer;
}
.sound-toggle {
  font-size: 18px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: opacity var(--transition);
}
.sound-toggle:hover { opacity: 0.7; }

/* ============================================================
   MOVE LOG
   ============================================================ */
.move-log {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  flex: 1;
  min-height: 0;
}
/* Hide on mobile */
@media (max-width: 1023px) { .move-log { display: none; } }

.log-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--brown-mid);
  margin-bottom: 6px;
}
.log-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 120px;
  overflow-y: auto;
  padding-right: 4px;
}
.log-list::-webkit-scrollbar { width: 3px; }
.log-list::-webkit-scrollbar-track { background: var(--safe-bg); border-radius: 4px; }
.log-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.log-entry {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--brown-dark);
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.log-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============================================================
   AD SLOT
   ============================================================ */
.ad-slot {
  display: none; /* hidden by default when empty */
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 4px 12px;
  padding-bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px));
}
.ad-slot:not(:empty) {
  display: block; /* CSS-only show when content injected */
  margin: 0 auto;
  border: 1px solid #7a5234;
}
@media (min-width: 1024px) {
  .ad-slot { padding: 6px 24px 12px; }
  .ad-slot:not(:empty) { display: block; }
}

/* ============================================================
   MOBILE NAV
   ============================================================ */
.mobile-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--mobile-nav-h);
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  z-index: 20;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}
@media (min-width: 1024px) { .mobile-nav { display: none; } }

.mobile-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 12px;
  color: var(--brown-mid);
  font-size: 20px;
  transition: color var(--transition);
}
.mobile-tab.active { color: var(--brown); }
.tab-label { font-size: 11px; font-weight: 700; }

/* ============================================================
   GAME OVER OVERLAY
   ============================================================ */
.game-over-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(62,39,35,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease;
}
.game-over-overlay.hidden { display: none; }

.game-over-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  max-width: 340px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-md);
}
.winner-msg {
  font-size: 32px;
  font-weight: 900;
  margin-bottom: 8px;
}
.winner-msg.player-win { color: var(--green); }
.winner-msg.ai-win     { color: var(--blue); }
.winner-sub {
  font-size: 14px;
  color: var(--brown-mid);
  margin-bottom: 20px;
}
.overlay-actions { display: flex; flex-direction: column; gap: 10px; }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  bottom: calc(var(--mobile-nav-h) + 16px);
  left: 50%; transform: translateX(-50%);
  background: var(--brown-dark);
  color: #fff;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  white-space: nowrap;
  z-index: 50;
}
.toast.show { opacity: 1; }
@media (min-width: 1024px) { .toast { bottom: 24px; } }

/* ============================================================
   BELOW FOLD
   ============================================================ */
.below-fold {
  background: var(--bg);
  flex-grow: 1;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ============================================================
   CONTENT SECTIONS
   ============================================================ */
.content-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 16px 0;
}
@media (min-width: 1024px) { .content-section { padding: 40px 32px 0; } }

.content-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  border: 1px solid var(--board-bg);
}
@media (min-width: 1024px) { .content-card { padding: 28px 32px; } }

.card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}
.card-header h2 {
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--brown-dark);
}
@media (min-width: 1024px) { .card-header h2 { font-size: 22px; } }

.win-rate-badge {
  font-size: 13px;
  font-weight: 700;
  background: var(--safe-bg);
  color: var(--brown);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(212,197,169,0.5);
  white-space: nowrap;
}

.table-wrapper { overflow-x: auto; }
.table-wrapper::-webkit-scrollbar { height: 4px; }
.table-wrapper::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.history-table {
  width: 100%;
  min-width: 520px;
  font-size: 14px;
}
.history-table thead tr {
  border-bottom: 2px solid var(--border);
  color: var(--brown-mid);
  font-size: 13px;
}
.history-table th, .history-table td {
  padding: 10px 8px;
  text-align: left;
}
.history-table tbody tr {
  border-bottom: 1px dashed rgba(212,197,169,0.5);
  transition: background var(--transition);
}
.history-table tbody tr:hover { background: rgba(250,243,224,0.5); }
.diff-badge {
  background: var(--safe-bg);
  color: var(--brown-mid);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(212,197,169,0.3);
}
td.win    { color: var(--green); font-weight: 700; }
td.lose   { color: var(--red);   font-weight: 700; }
.empty-history { text-align: center; color: var(--brown-mid); padding: 24px; font-size: 14px; }

/* ============================================================
   TUTORIAL ARTICLE
   ============================================================ */
.tutorial-article {
  max-width: 1100px;
  margin: 28px auto;
  padding: 0 16px 20px;
  position: relative;
  background: #fffdf8;
  border-radius: 20px;
  box-shadow: 0 8px 30px rgba(139,94,60,0.06);
  border: 1px solid #e8dfc8;
  overflow: hidden;
}
@media (min-width: 1024px) { .tutorial-article { margin: 40px auto; padding: 0 32px 32px; } }

.tutorial-stripe {
  height: 6px;
  background: repeating-linear-gradient(45deg,#8b5e3c,#8b5e3c 10px,#d4c5a9 10px,#d4c5a9 20px);
  opacity: 0.8;
  margin: 0 -16px;
}
@media (min-width: 1024px) { .tutorial-stripe { margin: 0 -32px; } }

.tutorial-body { padding: 24px 0 0; }
@media (min-width: 1024px) { .tutorial-body { padding: 32px 0 0; } }

.tutorial-header { text-align: center; margin-bottom: 32px; }
.tutorial-badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  background: var(--safe-bg);
  color: var(--brown);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  border: 1px solid rgba(212,197,169,0.5);
  margin-bottom: 16px;
}
.tutorial-header h1 {
  font-size: 26px;
  font-weight: 900;
  color: var(--brown-dark);
  margin-bottom: 8px;
  line-height: 1.3;
}
@media (min-width: 1024px) { .tutorial-header h1 { font-size: 36px; } }
.tutorial-subtitle { font-size: 16px; color: var(--brown-mid); margin-bottom: 18px; font-weight: 500; }
.tutorial-divider {
  width: 56px; height: 3px;
  background: var(--brown);
  border-radius: 4px;
  margin: 0 auto;
  opacity: 0.8;
}

.intro-block {
  background: var(--card-bg);
  padding: 20px 24px;
  border-radius: var(--radius-md);
  border: 1px solid #f0e6d2;
  box-shadow: var(--shadow-sm);
  margin-bottom: 40px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--brown-soft);
}
.intro-block strong { color: var(--brown); }

/* Section title row */
.section-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.section-icon {
  width: 40px; height: 40px;
  background: var(--brown);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(139,94,60,0.3);
}
.section-title-row h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--brown-dark);
}
@media (min-width: 1024px) { .section-title-row h2 { font-size: 24px; } }

/* Rules grid */
.rules-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 40px;
}
@media (min-width: 640px) { .rules-grid { grid-template-columns: repeat(2,1fr); } }

.rule-card {
  background: rgba(250,243,224,0.5);
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid #e8dfc8;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}
.rule-card:hover {
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.rule-num {
  position: absolute;
  right: -10px; top: -16px;
  font-size: 64px;
  font-weight: 900;
  color: var(--border);
  opacity: 0.18;
  line-height: 1;
  pointer-events: none;
}
.rule-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--brown-dark);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.rule-badge {
  width: 22px; height: 22px;
  background: var(--border);
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}
.rule-card p { font-size: 13px; color: var(--brown-soft); line-height: 1.7; }
.rule-card p strong { color: var(--brown); }

/* Strategy section */
.strategy-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.divider-line { flex: 1; height: 1px; background: linear-gradient(to right, transparent, var(--border)); }
.strategy-divider h2 {
  font-size: 16px; font-weight: 800; color: var(--brown-dark);
  text-align: center; padding: 0 8px;
  white-space: nowrap;
}
@media (min-width: 640px) { .strategy-divider h2 { font-size: 20px; } }

.strategy-intro {
  text-align: center;
  color: var(--brown-soft);
  margin-bottom: 24px;
  max-width: 700px;
  margin-left: auto; margin-right: auto;
  font-size: 14px;
}

.strategy-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 40px;
}
@media (min-width: 640px) { .strategy-grid { grid-template-columns: repeat(2,1fr); } }

.strategy-card {
  background: #fffcf5;
  padding: 20px;
  border-radius: var(--radius-md);
  border: 2px dashed var(--border);
  position: relative;
  transition: border-color var(--transition);
}
.strategy-card:hover { border-color: rgba(139,94,60,0.5); }
.strategy-tag {
  position: absolute;
  top: -12px; left: -8px;
  background: var(--brown);
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  transform: rotate(-4deg);
}
.strategy-card h3 { font-size: 15px; font-weight: 700; color: var(--brown); margin: 6px 0 10px; }
.strategy-card p  { font-size: 13px; color: var(--brown-soft); line-height: 1.7; }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.faq-item {
  padding: 16px 18px;
  background: var(--card-bg);
  border: 1px solid #f0e6d2;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.faq-item:hover { box-shadow: var(--shadow-md); }
.faq-item h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--brown-dark);
  margin-bottom: 8px;
  line-height: 1.5;
}
.faq-item p { font-size: 13px; color: var(--brown-soft); line-height: 1.75; }
.faq-item p strong { color: var(--brown-dark); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--brown-dark);
  color: rgba(255,255,255,0.8);
  padding: 28px 16px;
  margin-top: auto;
}
.footer-inner { max-width: 1440px; margin: 0 auto; text-align: center; }
.footer-desc { font-size: 13px; margin-bottom: 10px; font-weight: 500; line-height: 1.6; }
.footer-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}
.footer-meta a { color: rgba(255,255,255,0.6); }
.footer-meta a:hover { color: rgba(255,255,255,0.9); }

/* ============================================================
   MOBILE PANEL VISIBILITY (JS-controlled classes)
   ============================================================ */
@media (max-width: 1023px) {
  /* Show settings panel items only when settings tab active */
  #controlSettingsPanel.visible { display: flex; }
  .prob-panel.visible  { display: block; }
  .sound-controls.visible { display: flex; }
  .move-log.visible { display: block; }

  /* Game panel items always show in game tab */
  #controlGamePanel { display: block; }
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--safe-bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ============================================================
   UTILITIES
   ============================================================ */
.hidden { display: none !important; }
.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;
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .header, .mobile-nav, .game-over-overlay, .ad-slot, .sound-controls { display: none; }
}
