.puzzle-game { --puzzle-ink: #25262b; --puzzle-coral: #f25565; --puzzle-green: #247b66; width: 100%; max-width: 520px; margin: 0 auto; color: var(--puzzle-ink); font-family: inherit; }
.puzzle-game * { box-sizing: border-box; }
.puzzle-game .puzzle-instructions { margin: 0 0 20px; color: #707178; font-size: 13px; line-height: 1.85; }
.puzzle-game button { font: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation; cursor: pointer; }
.puzzle-game button:focus-visible { outline: 3px solid #247b66; outline-offset: 3px; position: relative; z-index: 1; }
.puzzle-game button:disabled { cursor: default; }
.puzzle-game .puzzle-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.puzzle-game .puzzle-stats { display: flex; align-items: center; gap: 15px; min-width: 0; font-size: 12px; color: #75777e; font-variant-numeric: tabular-nums; }
.puzzle-game .puzzle-stats span { white-space: nowrap; }
.puzzle-game .puzzle-stats b { color: #303239; font-size: 19px; font-weight: 750; }
.puzzle-game .puzzle-restart { border: 1px solid #e7e7eb; background: #fff; color: #55565c; padding: 8px 12px; border-radius: 7px; font-size: 12px; white-space: nowrap; min-height: 36px; }
.puzzle-game .puzzle-restart:hover { background: #f6f7f9; border-color: #d6d7de; }
.puzzle-game .puzzle-options { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.puzzle-game .puzzle-options:empty { display: none; }
.puzzle-game .puzzle-mode { border: 1px solid #e3e4e8; border-radius: 7px; padding: 8px 12px; background: #fff; color: #666871; font-size: 12px; min-height: 36px; }
.puzzle-game .puzzle-mode[aria-pressed="true"] { border-color: var(--puzzle-coral); background: #fff0f1; color: #d83d4d; }
.puzzle-game .puzzle-option-note { font-size: 11px; color: #94959b; }
.puzzle-game .puzzle-board { display: grid; width: 100%; margin: 0 auto; }
.puzzle-game .puzzle-status { min-height: 40px; margin: 18px 0 0; text-align: center; color: #777980; font-size: 13px; line-height: 1.8; }
.puzzle-game .puzzle-status.is-success { color: var(--puzzle-green); font-weight: 650; }
.puzzle-game .puzzle-status.is-failure { color: #ce4d5b; }
.puzzle-game--memory .puzzle-board { max-width: 408px; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 12px; background: #f8f5f1; border-radius: 13px; }
.puzzle-game .puzzle-card { aspect-ratio: 1; border: 1px solid #ecdcd7; border-radius: 9px; min-width: 0; padding: 0; font-size: 32px; color: #d69b90; background: #f1ded6; box-shadow: 0 3px 0 #e1cbc4; transition: background .2s, transform .2s; }
.puzzle-game .puzzle-card:hover:not(:disabled) { background: #ecd3c9; transform: translateY(-2px); }
.puzzle-game .puzzle-card.is-flipped { background: #fff; border-color: #f0e8df; box-shadow: 0 3px 0 #e9e0d4; transform: none; }
.puzzle-game .puzzle-card.is-matched { background: #edf6ed; border-color: #d4e8d3; box-shadow: 0 3px 0 #d9e8d6; }
.puzzle-game--mines { max-width: 440px; }
.puzzle-game--mines .puzzle-board { max-width: 384px; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; padding: 9px; background: #e6ece9; border: 1px solid #dde5e0; border-radius: 9px; }
.puzzle-game .puzzle-mine { aspect-ratio: 1; min-width: 0; padding: 0; border: 1px solid #d3ddd6; border-bottom-width: 3px; border-radius: 4px; background: #f8fcf9; color: #247b66; font-weight: 750; font-size: 18px; }
.puzzle-game .puzzle-mine:hover:not(:disabled) { background: #dfeee2; }
.puzzle-game .puzzle-mine.is-revealed { background: #e4eae6; border-color: transparent; }
.puzzle-game .puzzle-mine[data-number="2"] { color: #45804b; }
.puzzle-game .puzzle-mine[data-number="3"] { color: #d06650; }
.puzzle-game .puzzle-mine[data-number="4"] { color: #8567a6; }
.puzzle-game .puzzle-mine[data-number="5"], .puzzle-game .puzzle-mine[data-number="6"], .puzzle-game .puzzle-mine[data-number="7"], .puzzle-game .puzzle-mine[data-number="8"] { color: #a64858; }
.puzzle-game .puzzle-mine.is-flagged { color: #df5b62; background: #fff1ef; }
.puzzle-game .puzzle-mine.is-mine { color: #6d7c72; }
.puzzle-game .puzzle-mine.is-exploded { color: #c73e4d; background: #ffd9dc; border-color: #f2bec3; }
.puzzle-game .puzzle-board.is-flag-mode { border-color: #edb8bd; }
.puzzle-game--tictactoe { max-width: 410px; }
.puzzle-game .puzzle-segment { display: flex; padding: 4px; gap: 4px; width: 100%; background: #f1f2f4; border-radius: 8px; }
.puzzle-game .puzzle-segment button { flex: 1; padding: 8px 12px; border: 0; border-radius: 5px; color: #85868e; font-size: 12px; background: transparent; }
.puzzle-game .puzzle-segment button[aria-pressed="true"] { background: #fff; color: #3e4149; box-shadow: 0 1px 4px #25262b0d; }
.puzzle-game .puzzle-player { padding: 4px 8px; border-radius: 5px; }
.puzzle-game .puzzle-player.is-current { background: #fff0f1; color: #c64b58; }
.puzzle-game .puzzle-player b { font-size: 22px; vertical-align: -1px; }
.puzzle-game--tictactoe .puzzle-board { max-width: 338px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; padding: 12px; background: #f6f3f7; border-radius: 12px; }
.puzzle-game .puzzle-tic { aspect-ratio: 1; min-width: 0; border: 1px solid #ece8ee; border-bottom-width: 3px; border-radius: 8px; background: #fff; color: #f25565; font-family: system-ui, sans-serif; font-weight: 500; line-height: 1; font-size: clamp(42px, 8vw, 60px); padding: 0 0 7px; }
.puzzle-game .puzzle-tic:hover:not(:disabled) { background: #ffeff1; }
.puzzle-game .puzzle-tic.is-o { color: #6e78aa; }
.puzzle-game .puzzle-tic.is-winning { background: #e5f3e9; border-color: #cce2d3; color: #247b66; }
@media (max-width: 400px) {
  .puzzle-game .puzzle-toolbar { gap: 6px; }
  .puzzle-game .puzzle-stats { gap: 8px; font-size: 11px; }
  .puzzle-game .puzzle-stats b { font-size: 17px; }
  .puzzle-game .puzzle-restart { padding: 7px 8px; font-size: 11px; }
  .puzzle-game--memory .puzzle-board { gap: 7px; padding: 9px; }
  .puzzle-game .puzzle-card { font-size: 27px; border-radius: 6px; }
  .puzzle-game--mines .puzzle-board { gap: 3px; padding: 6px; }
  .puzzle-game .puzzle-mine { font-size: 15px; }
  .puzzle-game .puzzle-option-note { font-size: 10px; }
  .puzzle-game .puzzle-player { padding: 4px; }
}
@media (prefers-reduced-motion: reduce) { .puzzle-game .puzzle-card { transition: none; } }
