@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&family=Roboto+Condensed:wght@400;500;600;700;800&display=swap');

/* Oyun Arası oyun sayfaları için ortak iskelet.
   Her oyunun kendi styles.css dosyasından sonra yüklenir; ana sayfanın renklerini,
   yazı tiplerini ve logosunu oyunlara taşır. Oyunun vurgu rengi <body data-game>
   üzerinden gelir ve oyunların kullandığı --green / --deep değişkenlerine bağlanır. */
html { background: #f8f4ec; }

body.game-page {
  --accent: #0a2fb5;
  --accent-deep: #07227f;
  --accent-soft: #e4e9fb;
  --orange: #f25a1d;
  --paper: #f8f4ec;
  --ink: #0d1b4c;
  --muted: #59607c;
  --surface: #fffdf8;
  --line: #e7e2d6;
  --green: var(--accent);
  --deep: var(--accent);
  --mint: var(--accent-soft);
  --lime: #fecf40;
  --shadow: 0 18px 44px rgb(13 27 76 / .1);
  background: var(--paper);
  color: var(--ink);
  font-family: 'Roboto Condensed', system-ui, sans-serif;
}
body[data-game='2048'] { --accent: #0a2fb5; --accent-deep: #07227f; --accent-soft: #e4e9fb; }
body[data-game='mayin-tarlasi'] { --accent: #1768a0; --accent-deep: #0f4c77; --accent-soft: #dcf1fb; }
body[data-game='hafiza'] { --accent: #6a3dc2; --accent-deep: #4f2a99; --accent-soft: #efe6fc; }
body[data-game='xox'] { --accent: #0a2fb5; --accent-deep: #07227f; --accent-soft: #e4e9fb; }
body[data-game='sudoku'] { --accent: #b86e00; --accent-deep: #7d4a00; --accent-soft: #fdf0d2; }
body[data-game='tetris'] { --accent: #5b2bb5; --accent-deep: #3d1c7c; --accent-soft: #ece3fb; }
body[data-game='soliter'] { --accent: #0f7a55; --accent-deep: #0a5239; --accent-soft: #dcf2e9; }
body[data-game='mahjong'] { --accent: #2f7d3a; --accent-deep: #1f5527; --accent-soft: #e2f1e3; }
body[data-game='kelime-avi'] { --accent: #c2185b; --accent-deep: #85103e; --accent-soft: #fbe1ec; }
body[data-game='araba'] { --accent: #d6362b; --accent-deep: #93221a; --accent-soft: #fde2df; }
body[data-game='sekil'] { --accent: #c43d78; --accent-deep: #892852; --accent-soft: #fbe2ee; }
body[data-game='harfane'] { --accent: #1f7a4d; --accent-deep: #14553f; --accent-soft: #e0f2e8; --green-dark: #14553f; }

.game-page a { text-decoration: none; }
.game-page :is(a, button, select, input, [tabindex]):focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
.game-page :is(kbd, input, select, textarea) { font-family: inherit; }
.game-page :is(.heading h1, .game-heading h1, .home-heading h1, .game-intro h1, .overlay-card h2, .how-to h2, .modal h2,
  .score-card > strong, .stats strong, .counters strong, .scoreboard strong, .turn-card strong, .progress-copy > strong,
  .mode-card strong, .streak-card strong, .stat strong, #countdown, .tile, .cell, .how-icon) {
  font-family: 'Fredoka', 'Roboto Condensed', sans-serif;
  letter-spacing: -.01em;
}
.game-page :is(.heading h1, .game-heading h1, .home-heading h1, .game-intro h1) { font-weight: 700; letter-spacing: -.02em; }
.game-page :is(.heading h1, .game-heading h1) > span { color: var(--orange); }

/* header: same logo as the landing page */
.game-page .topbar { height: 68px; border-bottom-color: var(--line); }
.game-page .brand { display: inline-flex; align-items: center; gap: 10px; }
.game-page .site-header .brand::before { width: 38px; height: 34px; flex: none; background: #ffa915; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 24'%3E%3Cpath fill='black' d='M7 4h18a5 5 0 0 1 4.8 3.7l2 8.1a3.5 3.5 0 0 1-5.5 3.6L22 16H10l-4.3 3.4a3.5 3.5 0 0 1-5.5-3.6l2-8.1A5 5 0 0 1 7 4Zm2 3v3H6v3h3v3h3v-3h3v-3h-3V7H9Zm14 2a1.6 1.6 0 1 0 0 3.2A1.6 1.6 0 0 0 23 9Zm4 4a1.6 1.6 0 1 0 0 3.2A1.6 1.6 0 0 0 27 13Z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 24'%3E%3Cpath fill='black' d='M7 4h18a5 5 0 0 1 4.8 3.7l2 8.1a3.5 3.5 0 0 1-5.5 3.6L22 16H10l-4.3 3.4a3.5 3.5 0 0 1-5.5-3.6l2-8.1A5 5 0 0 1 7 4Zm2 3v3H6v3h3v3h3v-3h3v-3h-3V7H9Zm14 2a1.6 1.6 0 1 0 0 3.2A1.6 1.6 0 0 0 23 9Zm4 4a1.6 1.6 0 1 0 0 3.2A1.6 1.6 0 0 0 27 13Z'/%3E%3C/svg%3E") center / contain no-repeat; content: ''; }
.logo-word { font: 700 30px / 1 'Fredoka', sans-serif; letter-spacing: -.02em; background: linear-gradient(90deg, #061a6e, #0a36b5); -webkit-background-clip: text; background-clip: text; color: transparent; white-space: nowrap; }
.logo-word span { -webkit-text-fill-color: #f25a1a; }
.game-page .back-link { color: var(--ink); font-size: 14px; font-weight: 500; }
.game-page .back-link:hover { color: var(--accent); }
.game-page :is(.account-button, .auth-button) { white-space: nowrap; }
.game-page .account-button { border-color: var(--line); background: var(--surface); color: var(--ink); font-size: 14px; }
.game-page .account-button:hover { border-color: var(--accent); color: var(--accent); }
.game-page .account-eyebrow, .game-page .account-switch { color: var(--accent); }
.game-page .account-submit { background: var(--ink); }
.game-page .account-form input:focus { border-color: var(--accent); outline-color: color-mix(in srgb, var(--accent) 20%, transparent); }

/* site header: logo, search, all games, account — same pieces as the landing page */
.site-header { display: flex; align-items: center; gap: 18px; }
.game-shell > .site-header { position: relative; left: 50%; width: min(calc(100vw - 48px), 1560px); transform: translateX(-50%); }
.site-header .brand { margin-right: auto; }
.site-search { display: flex; align-items: center; gap: 10px; flex: 0 1 460px; height: 42px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.site-search:focus-within { border-color: var(--accent); }
.site-search svg, .search-link svg { width: 19px; height: 19px; flex: none; fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; }
.site-search input { min-width: 0; flex: 1; border: 0; outline: 0; padding: 0; background: transparent; color: var(--ink); font: 400 15px 'Roboto Condensed', sans-serif; }
.site-search input::placeholder { color: #8d8f9c; }
.search-link { display: none; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: #ebe7de; }
.all-games { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-size: 16px; font-weight: 600; white-space: nowrap; }
.all-games svg { width: 22px; height: 22px; fill: var(--ink); }
.all-games:hover { color: var(--accent); }
.site-header .account-slot { padding-left: 18px; border-left: 1px solid var(--line); }
.game-page .site-header .account-button { display: flex; align-items: center; gap: 10px; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--ink); font: 700 16px 'Roboto Condensed', sans-serif; }
.game-page .site-header .account-button::before { content: ''; width: 40px; height: 40px; flex: none; border-radius: 50%; background: #0d2272 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Ccircle cx='12' cy='8.6' r='3.6'/%3E%3Cpath d='M5.6 17.6c0-2.7 2.2-4.5 4.9-4.5h3c2.7 0 4.9 1.8 4.9 4.5v.8H5.6z'/%3E%3C/svg%3E") center / 62% no-repeat; }
.game-page .site-header .account-button::after { margin-left: 4px; color: var(--muted); content: '⌄'; font-size: 15px; }
.game-page .site-header .account-button:hover { color: var(--accent); }

@media (min-width: 761px) and (max-width: 900px) {
  .site-header { gap: 12px; }
  .site-search { flex-basis: clamp(140px, 23vw, 180px); min-width: 0; }
  .site-header .account-slot { padding-left: 12px; }
}

/* readable minimum sizes */
.game-page .eyebrow { font-size: 12px; letter-spacing: .12em; }
.game-page .intro, .game-page .intro-copy { font-size: 15px; }
.game-page :is(.stats span, .counters span, .scoreboard span, .score-card > span, .level-picker, .aside-label, .footer-label) { font-size: 11px; }
.game-page :is(.status, .message) { font-size: 14px; }
.game-page :is(.help, .board-help, .save-state, .best, .how-to p) { font-size: 13px; line-height: 1.6; }
.game-page .board-footer { font-size: 11px; }
.game-page kbd { font-size: 12px; }
.game-page .level-picker select { font-size: 14px; }
.game-page .overlay-kicker { font-size: 12px; }

/* buttons */
.game-page .button { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 700; }
.game-page :is(.primary, .button-primary) { border-color: var(--accent); background: var(--accent); color: #fff; }
.game-page :is(.primary, .button-primary):hover:not(:disabled) { border-color: var(--accent-deep); background: var(--accent-deep); }
.game-page .button-primary span { color: var(--lime); }
.game-page :is(.quiet, .button-quiet) { border-color: var(--line); background: var(--surface); color: var(--ink); }
.game-page :is(.quiet, .button-quiet):hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.game-page .quiet[aria-pressed='true'] { border-color: var(--orange); background: #ffe7dc; color: #9a3208; }

/* surfaces */
.game-page :is(.score-card, .stats > div, .counters > div, .scoreboard > div, .turn-card) { border-color: var(--line); background: var(--surface); }
.game-page .best-card { background: var(--accent-soft); }

/* Harfle (games/harfane) keeps its own layout; the platform header and colors come from here */
body[data-game='harfane'] .topbar { gap: 16px; padding-bottom: 0; }
body[data-game='harfane'] .crumbs { padding-inline: 0; }
.play-extras { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 20px; align-items: start; margin: 32px 0 30px; }
.play-extras > .how-card, .play-extras > .goal-card, .play-extras > .more-card { grid-area: auto; }
.play-extras .goal-equation b { min-width: 52px; height: 52px; font-size: 26px; }
.goal-equation .goal-green { background: #2f9e62; color: #fff; }
.goal-equation .goal-yellow { background: #f4c84f; color: var(--ink); }
.goal-equation .goal-gray { background: #8f9892; color: #fff; }
@media (max-width: 1099px) { .play-extras { grid-template-columns: repeat(2, minmax(0, 1fr)); } .play-extras .how-card { grid-column: 1 / -1; } }
@media (max-width: 760px) { .play-extras { display: flex; flex-direction: column; gap: 14px; margin-top: 32px; } .play-extras > * { width: 100%; } }
body[data-game='harfane'] .share-button:disabled { opacity: .45; cursor: not-allowed; }

/* more games + footer */
.more-games { margin: 8px 0 34px; padding-top: 24px; border-top: 1px solid var(--line); }
.more-games-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.more-games h2 { margin: 0; color: var(--ink); font: 700 22px / 1 'Roboto Condensed', sans-serif; letter-spacing: -.01em; }
.more-games-all { color: var(--ink); font-size: 14px; font-weight: 600; white-space: nowrap; }
.more-games-all:hover { color: var(--accent); }
.more-games-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.more-tile { display: grid; align-content: start; gap: 8px; min-width: 0; padding: 6px 6px 10px; border-radius: 16px; background: #fff; box-shadow: 0 3px 10px rgb(13 27 76 / .1); transition: transform .18s, box-shadow .18s; }
.more-art { position: relative; display: block; aspect-ratio: 1; overflow: hidden; border-radius: 11px; background: #e4dfd3; }
.more-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.more-tile.wide .more-art img { object-position: left center; }
.more-cover { display: grid; grid-template-columns: repeat(var(--cols), 1fr); align-content: center; justify-content: center; gap: 5%; height: 100%; padding: 16%; background: var(--c); }
.more-cover i { display: grid; place-items: center; aspect-ratio: 1; border-radius: 18%; background: #fff; color: var(--t, var(--ink)); font: 700 clamp(12px, 2.2vw, 20px) / 1 'Fredoka', sans-serif; font-style: normal; box-shadow: 0 2px 0 rgb(0 0 0 / .12); }
.more-cover[style*='--t'] i { background: rgb(255 255 255 / .16); }
.more-cover[style*='--cols: 4'] { gap: 4%; padding: 14% 9%; }
.more-cover i:empty { opacity: .7; }
.more-cover i[data-tone='g'] { background: #3fb56f; color: #fff; }
.more-cover i[data-tone='y'] { background: #f4c84f; color: var(--ink); }
.more-cover i[data-tone='x'] { background: #8f9892; color: #fff; }
.more-cover i[data-tone='r'] { background: #f0503a; color: #fff; }
.more-cover i[data-tone='b'] { background: #2f6fe0; color: #fff; }
.more-cover i[data-tone='c'] { background: #33c3e6; color: #fff; }
.more-cover i[data-tone='p'] { background: #a066ec; color: #fff; }
.more-cover i[data-tone='o'] { background: #ff9a2e; color: #fff; }
.more-cover i[data-tone='n'] { background: rgb(255 255 255 / .16); box-shadow: none; }
.more-cover i[data-tone='w'] { background: #fff; color: var(--ink); }
.more-cover i[data-tone='h'] { background: #fff; color: #d62f3a; }
.more-cover i[data-tone='j'] { background: #fff; color: #1f8a3c; }
.more-text { display: grid; gap: 2px; padding: 0 4px; }
.more-text strong { color: var(--ink); font: 700 16px / 1.15 'Roboto Condensed', sans-serif; }
.more-text small { overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
a.more-tile:hover, a.more-tile:focus-visible { transform: translateY(-3px); box-shadow: 0 10px 22px rgb(13 27 76 / .18); }
.game-page .footer { display: flex; justify-content: space-between; gap: 12px; padding: 16px 0 22px; border-top: 1px solid var(--line); align-items: center; border-top-color: var(--line); color: var(--muted); font-size: 13px; }
.game-page .footer .logo-word { color: transparent; font-size: 20px; }

@media (max-width: 760px) {
  .site-search, .all-games { display: none; }
  .search-link { display: grid; }
  .site-header { gap: 10px; }
  .site-header .account-slot { padding-left: 0; border-left: 0; }
  .game-shell > .site-header { width: calc(100vw - 24px); }
  .game-page .site-header .account-button { font-size: 0; gap: 0; }
}
@media (max-width: 600px) {
  .logo-word { font-size: 24px; }
  .game-page .back-link { font-size: 13px; }
  .more-games-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .game-page .stats > div { flex-direction: column; align-items: flex-start; gap: 2px; }
  .game-page .scoreboard > div { flex-direction: column; align-items: flex-start; gap: 2px; }
}
@media (max-width: 520px) {
  body[data-game='harfane'] .back-link { display: none; }
}
@media (max-width: 380px) {
  .logo-word { font-size: 21px; }
  .game-page .back-link { font-size: 12px; }
  body[data-game='harfane'] .site-header { gap: 5px; }
  body[data-game='harfane'] .site-header .brand { gap: 6px; }
  body[data-game='harfane'] .site-header .brand::before { width: 28px; height: 26px; }
  body[data-game='harfane'] .topbar-actions { gap: 4px; }
  body[data-game='harfane'] .site-header .logo-word { font-size: 16px; }
  body[data-game='harfane'] .search-link { width: 28px; height: 28px; }
  body[data-game='harfane'] .search-link svg { width: 16px; height: 16px; }
  body[data-game='harfane'] .topbar-actions .auth-button { padding: 4px 3px; font-size: 9px; }
  body[data-game='harfane'] .topbar-actions .icon-button { width: 28px; height: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .more-tile { transition: none; }
  a.more-tile:hover, a.more-tile:focus-visible { transform: none; }
}

/* Favori düğmesi (konum çubuğunun sağında) */
.favorite-toggle { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; padding: 7px 14px 7px 11px; border: 1.5px solid var(--line, #e2ddd0); border-radius: 999px; background: #fff; color: var(--ink, #0d1b4c); font-family: inherit; font-size: 14px; font-weight: 700; line-height: 1; cursor: pointer; transition: border-color .15s, background .15s; }
.crumbs .favorite-toggle svg { width: 18px; height: 18px; fill: none; stroke: #e0405f; stroke-width: 2; }
.favorite-toggle[aria-pressed='true'] { border-color: #f4b6c3; background: #fff0f3; }
.crumbs .favorite-toggle[aria-pressed='true'] svg { fill: #e0405f; }
.favorite-toggle:hover { border-color: #e0405f; }
@media (max-width: 760px) { .favorite-toggle span { display: none; } .favorite-toggle { padding: 7px 9px; } }
