@import url("https://fonts.googleapis.com/css2?family=Dosis:wght@400;500;600;700;800&display=swap");

:root {
  --brand-blue: #0065a0;
  --brand-dark: #0c486c;
  --footer-blue: #014c78;
  --footer-border: #037fc8;
  --orange: #ee6900;
  --orange-dark: #d65f00;
  --title: #0065a0;
  --line: #e0e0e0;
  --tile-text: #434343;
  --shadow: 0 1px 4px rgba(50, 50, 50, 0.25);
  --radius: 5px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: #1e1e1e;
  font-family: "Dosis", Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.35;
  background: var(--brand-dark);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.page {
  min-height: 100vh;
  background: var(--brand-dark);
}

.site-header {
  height: 47px;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 230px;
  align-items: center;
  gap: 12px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 8px;
  color: #d8f0fb;
  background: var(--brand-blue);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.38);
}

.logo {
  display: flex;
  align-items: center;
  width: 170px;
}

.logo img {
  width: 166px;
  height: auto;
  display: block;
}

.mobile-menu {
  display: none;
}

.main-menu {
  min-width: 0;
  height: 47px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
}

.main-menu a {
  height: 47px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-right: 1px solid #014c78;
  color: #d8f0fb;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.main-menu a:hover {
  color: #fff;
  background: #014c78;
}

.search {
  position: relative;
  height: 31px;
}

.search input {
  width: 100%;
  height: 31px;
  padding: 0 36px 0 10px;
  border: 2px solid #014c78;
  border-radius: 3px;
  outline: 0;
  color: #555;
  background: #dceef7;
  font-size: 13px;
  font-weight: 600;
}

.search button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 30px;
  height: 27px;
  border: 0;
  border-left: 1px solid #8fb8cc;
  background: #c4dbe8;
  cursor: pointer;
}

.search button::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  width: 10px;
  height: 10px;
  border: 2px solid #335d72;
  border-radius: 50%;
}

.search button::after {
  content: "";
  position: absolute;
  left: 18px;
  top: 17px;
  width: 8px;
  height: 2px;
  background: #335d72;
  transform: rotate(45deg);
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1084px) 356px;
  align-items: start;
  max-width: 1440px;
  margin: 0 auto;
  background: #3b3947;
}

.play-column {
  width: 100%;
  background: #fff;
}

/* Rating + paylaş şeridi yalnızca mobilde (oyun karesinin altında) görünür;
 * masaüstünde rating .title-row içinde kalır. */
.play-meta {
  display: none;
}

.game-frame {
  display: grid;
  grid-template-columns: 51px minmax(0, 1fr) 125px;
  min-height: 642px;
  background: #2f2f2f;
}

.game-tools {
  position: relative;
  /* Tooltip'ler iframe alanına taşar; ray oyunun (z:auto) üstünde boyansın.
   * 1 yeterli — header z:5'in ALTINDA kalmalı ki mega menü rayı örtebilsin. */
  z-index: 1;
  min-height: 642px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding-top: 20px;
  background: #303030;
  border-right: 1px solid #252525;
}

/* Araç butonları — referans (gamesgames.com): beyaz spil-icons glyph'leri
 * üstte, en altta Theatre Mode (SVG) + Full screen. */
.tool {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 37px;
  padding: 0;
  border: 0;
  color: #fff;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
}

/* Hover soluklaştırması yalnızca ikona uygulanır — .tool'a opacity vermek
 * stacking context yaratıp tooltip'i .player (iframe) altında bırakıyordu. */
.tool:hover i,
.tool:hover img {
  opacity: 0.8;
}

.tool i {
  font-size: 23px;
  line-height: 1;
}

.tool.full i {
  font-size: 20px;
}

.tool img {
  display: block;
  width: 21px;
  height: 21px;
}

.tool .ico-exit-theater {
  display: none;
}

body.pf-theater .tool .ico-theater {
  display: none;
}

body.pf-theater .tool .ico-exit-theater {
  display: block;
}

.tool-spacer {
  flex: 1 1 auto;
}

/* Tooltip — referans: beyaz kutu, mavi (#438afe) Dosis yazı, ikonun sağında ok uçlu */
.tool .ui-tooltip {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  padding: 12px 14px;
  border-radius: 4px;
  background: #fff;
  color: #438afe;
  font-family: 'Dosis', Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.tool .ui-tooltip::before {
  content: "";
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: #fff;
}

.tool:hover .ui-tooltip,
.tool:focus-visible .ui-tooltip {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .tool .ui-tooltip {
    transition: none;
  }
}

/* Theatre Mode — referans (gamesgames.com) davranışı: SAYFA İÇİNDE büyütme.
 * Oyun karesi yükselir (~%24, ref: 583→723), yandaki mini oyunlar ve
 * alttaki Similar games gizlenir; sayfa akışı/scroll bozulmaz.
 * Tam pencere isteyen Full screen butonudur (Fullscreen API). */
body.pf-theater .game-frame {
  grid-template-columns: 51px minmax(0, 1fr);
  min-height: 780px;
}

body.pf-theater .game-frame .last-played,
.game-frame:fullscreen .last-played {
  display: none;
}

body.pf-theater .player {
  min-height: 780px;
}

body.pf-theater .similar-row {
  display: none;
}

.game-frame:fullscreen {
  grid-template-columns: 51px minmax(0, 1fr);
}

.player {
  position: relative;
  min-height: 642px;
  overflow: hidden;
  background: linear-gradient(150deg, #22c7ba 0%, #20a7d4 58%, #7276bd 100%);
}

.loader {
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 44%;
  display: flex;
  gap: 18px;
  transform: translate(-50%, -50%);
  opacity: 0.4;
}

.loader span {
  width: 42px;
  height: 42px;
  border: 3px solid #555;
}

.loader span:nth-child(1) {
  border-radius: 50%;
}

.loader span:nth-child(2) {
  width: 0;
  height: 0;
  border-left: 26px solid transparent;
  border-right: 26px solid transparent;
  border-bottom: 45px solid #555;
  border-top: 0;
}

.start-screen {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: start;
  gap: 14px;
  padding-top: 90px;
  color: #fff;
}

.start-screen img {
  width: 178px;
  height: 178px;
  display: block;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.82);
  border-radius: 5px;
}

.start-screen button {
  width: 178px;
  height: 52px;
  border: 0;
  border-radius: 7px;
  color: #000;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 28px;
  font-weight: 800;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.86);
  cursor: pointer;
}

.start-screen h2 {
  margin: 112px 0 32px;
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 17px;
  font-weight: 500;
  text-transform: uppercase;
}

.start-screen p {
  width: min(560px, calc(100% - 60px));
  margin: 0;
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.last-played {
  min-height: 642px;
  padding: 0 5px 6px;
  background: #f6f6f6;
  border-left: 4px solid #fff;
  overflow: hidden;
}

.mini-tile {
  display: block;
  position: relative;
  margin-bottom: 6px;
  overflow: hidden;
  border: 1px solid #ddd;
  border-radius: 4px;
  color: var(--tile-text);
  background: #fff;
  box-shadow: var(--shadow);
}

.mini-tile img {
  display: block;
  width: 100%;
  aspect-ratio: 5 / 3;
  object-fit: cover;
  border: 2px solid #fff;
  border-bottom: 0;
}

.mini-tile span {
  display: block;
  height: 36px;
  padding: 8px 4px 4px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hot-badge {
  position: absolute;
  z-index: 2;
  left: 5px;
  top: 7px;
  width: 25px;
  height: 25px !important;
  padding: 0 !important;
  border-radius: 5px;
  background: var(--orange);
}

.hot-badge::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 5px;
  width: 8px;
  height: 13px;
  border-radius: 8px 8px 8px 8px;
  background: #fff;
}

.similar-row {
  padding: 6px 5px 4px;
  border-bottom: 5px solid #3b3947;
  background: #f4f4f4;
}

.similar-row h2 {
  display: none;
}

.horizontal-tiles {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
}

.tile {
  display: block;
  overflow: hidden;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  color: var(--tile-text);
  background: #fff;
  box-shadow: var(--shadow);
}

.tile img {
  display: block;
  width: 100%;
  aspect-ratio: 5 / 3;
  object-fit: cover;
  border: 2px solid #fff;
  border-bottom: 0;
}

.tile span {
  display: block;
  height: 32px;
  padding: 7px 4px 4px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-info {
  margin: 0 6px 12px;
  padding: 20px 30px 22px;
  color: #4c4c4c;
  border-radius: 3px;
  background: #fff;
  box-shadow: var(--shadow);
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.game-info h1 {
  margin: 0 0 12px;
  color: #404040;
  font-size: 30px;
  font-weight: 700;
}

.rating {
  display: flex;
  gap: 6px;
  padding-bottom: 10px;
}

/* Referans (gamesgames.com .rate-vote): gri yuvarlak buton,
 * renkli thumb glyph + yüzde, altında tooltip. */
.vote {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 60px;
  height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 5px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  background: #4a4a4a;
  cursor: pointer;
}

.vote:hover {
  background: #5a5a5a;
}

.vote i {
  font-size: 14px;
  line-height: 1;
}

.vote.up i {
  color: #7ac143;
}

.vote.down i {
  color: #e2574c;
}

.vote.is-voted {
  background: #438afe;
}

/* Oy verildikten sonra da tıklanabilir kalır (oy değiştirme / kaldırma). */
.rating.voted .vote.is-voted,
.rating.voted .vote.is-voted:hover {
  background: #438afe;
}

.rating.voted .vote:not(.is-voted) {
  opacity: 0.6;
}

.rating.voted .vote:not(.is-voted):hover {
  opacity: 1;
  background: #5a5a5a;
}

/* Oy tooltip'i — butonun altında, yukarı ok uçlu */
.vote .ui-tooltip {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  padding: 12px 14px;
  border-radius: 4px;
  background: #fff;
  color: #438afe;
  font-family: 'Dosis', Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.vote .ui-tooltip::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: #fff;
}

.vote:hover .ui-tooltip {
  opacity: 1;
}

.rating.voted .vote .ui-tooltip {
  display: none;
}

.game-info p,
.game-info li {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.65;
}

.game-info p {
  margin: 0 0 14px;
}

/* AI içeriği h2/h3 başlıklar + madde listeleri üretir; aralık ve madde
   işaretleri olmadan paragraflar "bitişik" görünüyordu. */
.game-info h2 {
  margin: 28px 0 10px;
  color: #2b2b2b;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
}

.game-info h3 {
  margin: 24px 0 8px;
  color: #3b3b3b;
  font-size: 19px;
}

.game-info ul,
.game-info ol {
  margin: 0 0 16px;
  padding-left: 24px;
}

.game-info ul { list-style: disc; }
.game-info ol { list-style: decimal; }

.game-info li { margin: 0 0 6px; }

.game-info a {
  color: var(--orange);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 22px;
}

.tags a {
  padding: 5px 10px;
  border-radius: 4px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  background: #349edb;
}

.ad-column {
  min-height: 100vh;
  padding: 12px 0 0 14px;
  background: #777;
}

.right-blank {
  min-height: 1660px;
  background: #3b3947;
}

.ad {
  width: 337px;
  max-width: calc(100vw - 20px);
  display: grid;
  place-items: start center;
  color: #a7a7a7;
  background: #f5f5f5;
}

.ad span {
  margin-top: 8px;
  font-size: 11px;
}

.ad-mpu {
  height: 280px;
  margin-bottom: 18px;
}

.ad-sky {
  position: sticky;
  top: 56px;
  height: 600px;
}

.footer {
  max-width: 1440px;
  margin: 0 auto;
  color: #d9f1fc;
  background: var(--footer-blue);
  border-top: 12px solid var(--footer-border);
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 46px;
  max-width: 980px;
  margin: 0 auto;
  padding: 36px 20px 42px;
}

.footer img {
  display: none;
}

.footer h6 {
  margin: 0 0 16px;
  color: #fff;
  font-size: 14px;
  text-transform: uppercase;
}

.footer a {
  display: block;
  margin-bottom: 13px;
  color: #d9f1fc;
  font-size: 13px;
  font-weight: 600;
}

.footer p {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px 28px;
  color: #d9f1fc;
  font-size: 12px;
}

@media (max-width: 1100px) {
  .site-header {
    grid-template-columns: 175px 1fr 190px;
  }

  .main-menu a {
    padding: 0 8px;
    font-size: 13px;
  }

  .game-layout {
    grid-template-columns: 1fr;
  }

  .ad-column,
  .right-blank {
    display: none;
  }
}

/* Tablet + telefon: referans mobil oynatma düzeni (oyun banner, rating/paylaş
 * şeridi, 2 sütun Similar) ve mobil header bu sınıra kadar geçerli. 1100px,
 * .game-layout'un tek sütuna düştüğü sınırla hizalıdır. */
@media (max-width: 1100px) {
  .site-header {
    position: relative;
    height: 48px;
    display: block;
    padding: 0;
  }

  .logo,
  .main-menu {
    display: none;
  }

  .mobile-menu {
    position: absolute;
    left: 13px;
    top: 13px;
    width: 22px;
    height: 18px;
    display: block;
    border: 0;
    border-top: 3px solid #baddf9;
    border-bottom: 3px solid #baddf9;
    background: transparent;
  }

  .mobile-menu::before {
    content: "";
    position: absolute;
    left: 0;
    top: 5px;
    width: 22px;
    height: 3px;
    background: #baddf9;
  }

  .search {
    position: absolute;
    right: 0;
    top: 0;
    width: 48px;
    height: 48px;
  }

  .search input {
    display: none;
  }

  .search button {
    top: 6px;
    right: 8px;
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
  }

  .search button::before {
    left: 8px;
    top: 7px;
    width: 13px;
    height: 13px;
    border-color: #baddf9;
  }

  .search button::after {
    left: 22px;
    top: 22px;
    width: 10px;
    background: #baddf9;
  }

  /* Referans (gamesgames.com/game/pou) gerçek mobil düzeni:
   * oyun alanı tam genişlik + kompakt yatay (landscape) "START GAME" ekranı;
   * sol araç şeridi ve sağ sütun gizli; altta 2 sütun Similar grid. */
  .game-frame {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .game-tools,
  .last-played {
    display: none;
  }

  /* Başlat ekranı: kompakt yatay banner. Oran (3:2) sabit; genişlik max-width
   * ile sınırlı ve ortalı, böylece telefonda tam genişlik kalırken iPad gibi
   * geniş tabletlerde banner orantısız büyümez (kompakt tablet görünümü). */
  .player {
    aspect-ratio: 3 / 2;
    width: 100%;
    max-width: 560px;
    margin-inline: auto;
    height: auto;
    min-height: 0;
  }

  /* PLAY'e basınca (is-playing) oyun tam genişlikte, gerçek yüksekliğine açılır. */
  .player.is-playing {
    aspect-ratio: auto;
    max-width: none;
    height: clamp(420px, 78vh, 620px);
  }

  /* Başlat ekranı içeriği: kapak arka planda (cover + karartma),
   * üstte ortalanmış PLAY + oyun adı. Uzun uyarı metni mobilde gizli. */
  .start-screen {
    align-content: center;
    gap: 14px;
    padding-top: 0;
  }

  .start-screen img {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    object-fit: cover;
    filter: brightness(0.55);
  }

  .start-screen button {
    position: relative;
    z-index: 1;
    width: 150px;
    height: 48px;
    font-size: 24px;
  }

  .start-screen h2 {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: 16px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  }

  .start-screen p {
    display: none;
  }

  /* Rating + paylaş şeridi — referanstaki gibi oyun karesinin hemen altında. */
  .play-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 14px;
    background: #2f2f2f;
  }

  .play-meta .rating {
    padding-bottom: 0;
  }

  .play-share {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 16px;
    border: 0;
    border-radius: 5px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    background: #4a4a4a;
    cursor: pointer;
  }

  .play-share:active {
    background: #5a5a5a;
  }

  /* Similar games — referanstaki gibi 2 sütun grid. */
  .horizontal-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 7px;
  }

  .game-info {
    margin: 8px 6px 18px;
    padding: 16px;
  }

  .title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .game-info h1 {
    font-size: 26px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 22px;
  }
}

/* ============================================================ *
 *  MOBİL TAM EKRAN (CSS tabanlı — iOS Safari Fullscreen API'siz)
 *  .pf-mobile-fs class'ı PLAY'e basınca theme.js tarafından eklenir.
 * ============================================================ */
body.pf-mobile-fs {
  overflow: hidden;
}
body.pf-mobile-fs .game-frame {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;        /* dvh desteklemeyen tarayıcılar için fallback */
  height: 100dvh;       /* mobil adres çubuğu daralmasına dayanıklı */
  z-index: 99999;
  margin: 0;
  padding: 0;
  background: #000;
  grid-template-columns: 1fr;
  min-height: 0;
}
body.pf-mobile-fs .player,
body.pf-mobile-fs .player.is-playing {
  width: 100%;
  height: 100%;
  max-width: none;
  aspect-ratio: auto;
  margin: 0;
  min-height: 0;
}
/* Tam ekranda sadece oyun görünür; çevre öğeler gizli. */
body.pf-mobile-fs .game-frame .last-played,
body.pf-mobile-fs .similar-row,
body.pf-mobile-fs .game-info,
body.pf-mobile-fs .play-meta,
body.pf-mobile-fs .wdg_header,
body.pf-mobile-fs footer {
  display: none !important;
}

/* Çıkış (kapat) butonu — 44×44 dokunma hedefi, çentik/safe-area güvenli. */
.pf-fs-exit {
  display: none;
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  right: calc(env(safe-area-inset-right, 0px) + 10px);
  z-index: 100000;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.pf-fs-exit:active {
  background: rgba(0, 0, 0, 0.85);
}
