/* ==========================================================================
   GAMIO HTML5 LANDING PAGE - MODERN PIXEL-PERFECT STYLESHEET
   Reference: Home-reference.png (1448 x 1086) - Revised Architecture
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS & RESET
   -------------------------------------------------------------------------- */
:root {
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-heading: 'Outfit', var(--font-main);

  --bg-page: #f3f0e6;
  --bg-card: #ffffff;
  --bg-subtle: #f8f6f0;
  --bg-input: #ffffff;

  --border-light: #ebe6da;
  --border-subtle: #f0ece2;
  --border-focus: #0d5565;

  --color-navy: #0f172a;
  --color-slate: #334155;
  --color-muted: #64748b;
  --color-light-muted: #94a3b8;

  --color-teal: #0d5565;
  --color-teal-hover: #09404c;
  --color-teal-light: #e0f2f1;

  --color-gold: #d97706;
  --color-gold-bright: #f59e0b;
  --color-gold-hover: #b45309;

  --color-okey: #1b5e20;
  --bg-okey: #e8f5e9;
  --border-okey: #c8e6c9;

  --color-tavla: #e65100;
  --bg-tavla: #fff3e0;
  --border-tavla: #ffe0b2;

  --color-101: #0277bd;
  --bg-101: #e1f5fe;
  --border-101: #bbdefb;

  --color-batak: #6a1b9a;
  --bg-batak: #f3e5f5;
  --border-batak: #e1bee7;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  --shadow-card: 0 4px 16px rgba(44, 38, 27, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
  --shadow-hover: 0 8px 24px rgba(44, 38, 27, 0.08), 0 2px 6px rgba(0, 0, 0, 0.03);
  --shadow-btn: 0 2px 6px rgba(13, 85, 101, 0.2);
  --shadow-gold: 0 2px 8px rgba(217, 119, 6, 0.3);
}

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

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-page);
  color: var(--color-navy);
  line-height: 1.45;
  min-width: 320px;
}

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

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

input, select {
  font-family: inherit;
  font-size: inherit;
}

.page-shell {
  width: 1448px;
  margin: 0 auto;
  padding: 0 40px 30px;
}

/* --------------------------------------------------------------------------
   2. COMMON CARD STYLES
   -------------------------------------------------------------------------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.card-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-header h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-navy);
}

.section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-navy);
}

.section-icon.gold {
  color: var(--color-gold-bright);
}

.see-all-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-teal);
  transition: color 0.15s ease, transform 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.see-all-link:hover {
  color: var(--color-teal-hover);
  transform: translateX(2px);
}

/* --------------------------------------------------------------------------
   3. HEADER / TOPBAR
   -------------------------------------------------------------------------- */
.topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  margin-left: -40px;
  margin-right: -40px;
  padding: 0 40px;
}

.topbar-inner {
  max-width: 1368px;
  height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-spade {
  width: 32px;
  height: 36px;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--color-navy);
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--color-muted);
  font-weight: 500;
}

.nav-main {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-slate);
  border-radius: var(--radius-sm);
  position: relative;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.nav-item .nav-icon {
  width: 17px;
  height: 17px;
  opacity: 0.75;
  transition: opacity 0.15s ease;
}

.nav-item:hover {
  color: var(--color-teal);
  background-color: var(--bg-subtle);
}

.nav-item:hover .nav-icon {
  opacity: 1;
}

.nav-item.active {
  color: var(--color-teal);
  font-weight: 700;
}

.nav-item.active .nav-icon {
  opacity: 1;
  filter: drop-shadow(0 1px 2px rgba(13, 85, 101, 0.25));
}

.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: -18px;
  left: 10px;
  right: 10px;
  height: 3px;
  background-color: var(--color-teal);
  border-radius: 3px 3px 0 0;
}

/* Header Socials */
.topbar-socials {
  display: flex;
  align-items: center;
  gap: 7px;
  border-left: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  padding: 0 12px;
}

.topbar-soc-link {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f7f5ed;
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-slate);
  transition: all 0.15s ease;
}

.topbar-soc-link:hover {
  background: var(--color-teal);
  color: #ffffff;
  border-color: var(--color-teal);
  transform: translateY(-1px);
}

.topbar-soc-link:hover img {
  filter: brightness(0) invert(1);
}

/* Header Apps */
.topbar-apps {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-app-link {
  display: inline-block;
  line-height: 0;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.topbar-app-link:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.topbar-app-link img {
  display: block;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f4f2ea;
  border: 1px solid #e5dfd2;
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  width: 160px;
  transition: width 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.search-box:focus-within {
  width: 185px;
  background: #ffffff;
  border-color: var(--color-teal);
}

.search-icon {
  opacity: 0.55;
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.85rem;
  color: var(--color-navy);
  width: 100%;
}

.search-box input::placeholder {
  color: var(--color-muted);
}

.topbar-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.92rem;
  box-shadow: var(--shadow-gold);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  white-space: nowrap;
}

.topbar-play-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.4);
}

.btn-icon {
  filter: brightness(0) invert(1);
}

/* --------------------------------------------------------------------------
   4. THREE-COLUMN LAYOUT
   -------------------------------------------------------------------------- */
.layout-grid {
  display: grid;
  grid-template-columns: 320px 638px 380px;
  gap: 14px;
  margin-top: 14px;
}

.col-left, .col-center, .col-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* --------------------------------------------------------------------------
   5. LEFT COLUMN: AUTH CARD (GİRİŞ YAP & KAYIT OL)
   -------------------------------------------------------------------------- */
.card-login {
  padding: 20px;
}

.card-login-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: 14px;
}

.login-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #ebe6da;
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
  margin-bottom: 14px;
}

.tab-btn {
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-muted);
  border-radius: 6px;
  transition: all 0.15s ease;
}

.tab-btn.active {
  background: #ffffff;
  color: var(--color-navy);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.input-wrap {
  position: relative;
  width: 100%;
}

.input-wrap input {
  width: 100%;
  padding: 9px 13px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--color-navy);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-wrap input:focus {
  border-color: var(--color-teal);
  box-shadow: 0 0 0 3px rgba(13, 85, 101, 0.1);
}

.input-wrap.has-eye input {
  padding-right: 38px;
}

.eye-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.55;
  transition: opacity 0.15s ease;
  display: flex;
  align-items: center;
}

.eye-btn:hover {
  opacity: 1;
}

.form-row-remember {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  margin-top: -2px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  color: var(--color-slate);
}

.checkbox-label input {
  width: 15px;
  height: 15px;
  accent-color: var(--color-teal);
  cursor: pointer;
}

.forgot-link {
  color: var(--color-teal);
  font-weight: 500;
}

.forgot-link:hover {
  text-decoration: underline;
}

/* Custom Room Selector inside Login Card (Image 1 Reference) */
.custom-room-select-wrap {
  position: relative;
  width: 100%;
}

.room-dropdown-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-slate);
  margin-bottom: 4px;
}

.custom-room-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.custom-room-trigger:hover, .custom-room-trigger:focus-visible {
  border-color: var(--color-teal);
  box-shadow: 0 0 0 2px rgba(13, 85, 101, 0.1);
}

.custom-room-trigger.is-open {
  border-color: var(--color-teal);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.trigger-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.room-num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 5px;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 800;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  color: #1e3a8a;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
}

.room-num-badge.gold {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(217, 119, 6, 0.35);
}

.trigger-room-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--color-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.trigger-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.trigger-room-online {
  font-size: 0.78rem;
  font-weight: 700;
  color: #1e3a8a;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.trigger-room-online svg {
  fill: #3b82f6;
}

.room-gold-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.trigger-chevron {
  transition: transform 0.2s ease;
  color: var(--color-muted);
}

.custom-room-trigger.is-open .trigger-chevron {
  transform: rotate(180deg);
}

/* Floating Dropdown List matching Image 1 exactly (Hidden by default) */
.custom-room-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
  z-index: 250;
  max-height: 250px;
  overflow-y: auto;
  padding: 4px;
  flex-direction: column;
  gap: 3px;
}

.custom-room-dropdown.is-open {
  display: flex !important;
}

.room-select-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  border: 1px solid transparent;
}

.room-select-item:hover {
  background: #f1f5f9;
}

.room-select-item.selected {
  background: #fefce8;
  border-color: #fde047;
}

.room-select-item .item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.room-select-item .item-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 165px;
}

.room-select-item .item-right {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1e3a8a;
  flex-shrink: 0;
  margin-left: auto;
  text-align: right;
}

.room-select-item .item-right svg {
  fill: #3b82f6;
}

.btn-login-submit {
  background: var(--color-teal);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: var(--shadow-btn);
  transition: background 0.15s ease, transform 0.15s ease;
  text-align: center;
  margin-top: 2px;
}

.btn-login-submit:hover:not(:disabled) {
  background: var(--color-teal-hover);
  transform: translateY(-1px);
}

.btn-login-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-status {
  font-size: 0.82rem;
  text-align: center;
  min-height: 16px;
  color: #dc2626;
  margin-top: -3px;
}

.login-status.ok {
  color: #16a34a;
}

.login-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--color-muted);
  font-size: 0.78rem;
  margin: 1px 0;
}

.login-divider::before, .login-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e6e2d8;
}

.login-divider span {
  padding: 0 10px;
}

.social-login-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  background: #faf8f2;
  border: 1px solid #e4dfd4;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.social-btn:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.social-btn.google img, .social-btn.apple img, .social-btn.facebook img {
  width: 18px;
  height: 18px;
}

.login-footer {
  text-align: center;
  font-size: 0.82rem;
  color: var(--color-muted);
  margin-top: 4px;
}

.signup-link {
  color: var(--color-teal);
  font-weight: 700;
  margin-left: 4px;
}

.signup-link:hover {
  text-decoration: underline;
}

/* Register Form Specifics (Compact, balanced) */
.gender-radio-row {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.82rem;
  color: var(--color-slate);
  padding: 2px 2px;
}

.gender-label {
  font-weight: 700;
  color: var(--color-navy);
}

.radio-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.radio-item input {
  accent-color: var(--color-teal);
  cursor: pointer;
}

.dual-input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.form-row-terms {
  font-size: 0.78rem;
  color: var(--color-slate);
}

.terms-link {
  color: var(--color-teal);
  font-weight: 600;
}

.terms-link:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   6. LEFT COLUMN: GÜNCEL HABERLER CARD
   -------------------------------------------------------------------------- */
.card-news {
  padding: 18px;
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.news-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.news-item:hover {
  transform: translateX(2px);
}

.news-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid #e5e0d4;
  background-color: #f1ede4;
}

.news-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.news-title {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--color-navy);
  line-height: 1.25;
}

.news-desc {
  font-size: 0.76rem;
  color: var(--color-muted);
  line-height: 1.35;
  margin: 3px 0 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-date {
  font-size: 0.72rem;
  color: var(--color-light-muted);
}

/* --------------------------------------------------------------------------
   7. CENTER COLUMN: HERO SLIDER
   -------------------------------------------------------------------------- */
.hero-slider-wrap {
  width: 638px;
  height: 272px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-card);
  user-select: none;
  background-color: #031b24;
}

.hero-slides {
  width: 100%;
  height: 100%;
  position: relative;
}

.hero-slide {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center right;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  padding: 0 34px;
  transition: opacity 0.4s ease, transform 0.4s ease;
  position: absolute;
  inset: 0;
}

.hero-content {
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2;
}

.hero-headline {
  font-family: var(--font-heading);
  font-size: 1.95rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.15;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.hero-subline {
  font-size: 0.85rem;
  color: #cce7eb;
  line-height: 1.4;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.hero-cta-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  margin-top: 4px;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.4);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.hero-cta-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.35);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
  z-index: 3;
}

.hero-slider-wrap:hover .hero-arrow {
  opacity: 1;
}

.hero-arrow:hover {
  background: rgba(0, 0, 0, 0.65);
}

.hero-arrow.prev { left: 12px; }
.hero-arrow.next { right: 12px; }

.hero-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 3;
}

.dot-btn {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  transition: all 0.2s ease;
  padding: 0;
}

.dot-btn.active {
  background: #ffffff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

/* --------------------------------------------------------------------------
   8. CENTER COLUMN: POPÜLER OYUNLAR CARD (ALL 16 GAMES VIEWPORT)
   -------------------------------------------------------------------------- */
.card-games {
  padding: 18px 20px;
}

.games-count-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: #f1ede4;
  color: var(--color-teal);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}

.games-nav-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.games-page-indicator {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-muted);
  margin-right: 4px;
}

.games-nav-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #f3f0e6;
  border: 1px solid var(--border-light);
  color: var(--color-navy);
  font-size: 1.1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.games-nav-btn:hover:not(:disabled) {
  background: var(--color-teal);
  color: #ffffff;
  border-color: var(--color-teal);
}

.games-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.games-viewport {
  width: 100%;
  overflow: hidden;
  position: relative;
}

.games-slider-track {
  display: flex;
  width: 200%;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.games-page {
  width: 50%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  flex-shrink: 0;
}

.game-card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  outline: none;
  transition: transform 0.15s ease;
}

.game-card:hover, .game-card:focus-visible {
  transform: translateY(-2px);
}

.game-card.is-upcoming {
  cursor: default;
  opacity: 0.94;
}

.game-card.is-upcoming:hover {
  transform: translateY(-1px);
}

.game-thumb-wrap {
  width: 100%;
  height: 104px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #d8d3c5;
  background-color: #f5f2ea;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  position: relative;
}

.game-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.game-card:hover .game-img {
  transform: scale(1.03);
}

.game-live-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(13, 85, 101, 0.90);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(2px);
  letter-spacing: 0.3px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  z-index: 2;
}

.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
}

.game-upcoming-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(15, 23, 42, 0.82);
  color: #f8fafc;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  backdrop-filter: blur(2px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 2;
}

.game-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 5px;
  text-align: center;
}

.game-name {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--color-navy);
  line-height: 1.2;
}

.game-online {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.74rem;
  color: var(--color-muted);
  font-weight: 500;
  margin-top: 1px;
}

.game-online img {
  opacity: 0.65;
}

.game-status-tag {
  font-size: 0.74rem;
  color: var(--color-muted);
  font-weight: 600;
  margin-top: 1px;
}

/* --------------------------------------------------------------------------
   9. CENTER COLUMN: AKTİF SALONLAR (YATAY VE GENİŞ KART - 2 PAGES SLIDER)
   -------------------------------------------------------------------------- */
.card-rooms-wide {
  padding: 14px 18px;
  height: auto;
  overflow: hidden;
}

.online-pill-badge {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--color-okey);
  background: var(--bg-okey);
  border: 1px solid var(--border-okey);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.rooms-nav-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}

.rooms-page-indicator {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-muted);
  margin-right: 2px;
}

.rooms-nav-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f3f0e6;
  border: 1px solid var(--border-light);
  color: var(--color-navy);
  font-size: 1.05rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.rooms-nav-btn:hover:not(:disabled) {
  background: var(--color-teal);
  color: #ffffff;
  border-color: var(--color-teal);
}

.rooms-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.rooms-viewport {
  width: 100%;
  overflow: hidden;
  position: relative;
  margin-top: 2px;
}

.rooms-slider-track {
  display: flex;
  width: 200%;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.rooms-page {
  width: 50%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, auto);
  gap: 8px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.room-info-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: #faf8f2;
  pointer-events: none;
  user-select: none;
  box-sizing: border-box;
  min-height: 48px;
  min-width: 0;
  overflow: hidden;
  transition: transform 0.15s ease;
}

.room-info-card.is-gold {
  background: #fffbeb;
  border-color: #fde68a;
}

.ric-header {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  min-width: 0;
}

.ric-num {
  font-size: 0.65rem;
  font-weight: 800;
  width: 17px;
  height: 17px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  color: #334155;
  flex-shrink: 0;
}

.ric-num.gold {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  color: #ffffff;
}

.ric-title {
  font-family: var(--font-heading);
  font-size: 0.80rem;
  font-weight: 700;
  color: var(--color-navy);
  line-height: 1.15;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ric-footer {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #1e3a8a;
  margin-top: 3px;
}

.ric-online strong {
  color: var(--color-navy);
  font-weight: 700;
}

.pill-tag {
  font-size: 0.58rem;
  font-weight: 800;
  padding: 1px 3px;
  border-radius: 3px;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.pill-tag.risk {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.pill-tag.gold {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

/* --------------------------------------------------------------------------
   10. RIGHT COLUMN: EN İYİ OYUNCULAR
   -------------------------------------------------------------------------- */
.card-ranking {
  padding: 18px 20px;
}

.ranking-filter-pills {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #ebe6da;
  border-radius: var(--radius-pill);
  padding: 2px;
}

.pill-btn {
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-slate);
  border-radius: var(--radius-pill);
  transition: all 0.15s ease;
}

.pill-btn.active {
  background: #ffffff;
  color: var(--color-navy);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.ranking-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ranking-item {
  display: grid;
  grid-template-columns: 24px 30px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}

.rank-pos {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
}

.rank-pos.num {
  color: var(--color-navy);
  font-family: var(--font-heading);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #e2ddd0;
}

.user-nick {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--color-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-score {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--color-gold);
}

/* --------------------------------------------------------------------------
   11. RIGHT COLUMN: GÜNÜN GÖREVİ
   -------------------------------------------------------------------------- */
.card-mission {
  padding: 18px 20px;
}

.mission-timer {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-slate);
  background: #f4f1e9;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

.mission-desc {
  font-size: 0.82rem;
  color: var(--color-slate);
  margin-bottom: 10px;
}

.mission-status-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.mission-progress-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-bar-bg {
  flex: 1;
  height: 8px;
  background: #e9e4d8;
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--color-teal);
  border-radius: var(--radius-pill);
}

.progress-num {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-slate);
  white-space: nowrap;
}

.mission-reward-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff8eb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 4px 10px;
}

.reward-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.reward-text strong {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--color-navy);
}

.reward-text small {
  font-size: 0.7rem;
  color: var(--color-gold);
  font-weight: 600;
}

.btn-mission-action {
  width: 100%;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  padding: 9px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  text-align: center;
  box-shadow: var(--shadow-gold);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn-mission-action:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

/* --------------------------------------------------------------------------
   12. RIGHT COLUMN: YAKLAŞAN TURNOVA (Günün Görevi Altında)
   -------------------------------------------------------------------------- */
.card-tournament {
  padding: 18px 20px;
}

.tournament-card-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --------------------------------------------------------------------------
   12. RIGHT COLUMN: YAKLAŞAN TURNOVA CARD (DENGELİ 2 TURNUVA LİSTESİ)
   -------------------------------------------------------------------------- */
.card-tournament {
  padding: 16px 18px;
}

.tournaments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tournament-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #faf8f2;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.tournament-item:hover {
  background: #ffffff;
  transform: translateY(-1px);
  border-color: #cbd5e1;
}

.tournament-trophy-box {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e8dfc8;
  flex-shrink: 0;
  background: #fbf7ee;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tournament-trophy-box.silver {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.trophy-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.tournament-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.tournament-name {
  font-family: var(--font-heading);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--color-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tournament-meta {
  font-size: 0.72rem;
  color: var(--color-muted);
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

.tournament-prize {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--color-gold);
  font-weight: 700;
  margin-top: 1px;
}

.tournament-action-arrow {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-gold);
  transition: transform 0.15s ease, filter 0.15s ease;
  flex-shrink: 0;
}

.tournament-action-arrow:hover {
  transform: translateX(2px);
  filter: brightness(1.05);
}

.tournament-action-arrow img {
  filter: brightness(0) invert(1);
}

/* --------------------------------------------------------------------------
   13. BOTTOM ROW: THREE CARDS
   -------------------------------------------------------------------------- */
.bottom-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.card-bottom {
  padding: 18px 20px;
}

.bottom-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bottom-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}

.bottom-item .user-avatar {
  width: 24px;
  height: 24px;
}

.bottom-item .user-name {
  font-weight: 700;
  color: var(--color-navy);
}

.card-winners .bottom-item {
  display: grid;
  grid-template-columns: 24px 85px 105px 1fr auto;
  align-items: center;
  gap: 8px;
}

.room-tag {
  color: var(--color-101);
  font-weight: 500;
}

.reward-val {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-gold);
  text-align: right;
}

.time-ago {
  color: var(--color-light-muted);
  font-size: 0.74rem;
  text-align: right;
  white-space: nowrap;
}

.card-members .bottom-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-members .bottom-item .user-name {
  flex: 1;
  margin-left: 8px;
}

.add-friend-btn {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #f2ede4;
  border: 1px solid #ded8cb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-slate);
  transition: all 0.15s ease;
}

.add-friend-btn:hover {
  background: var(--color-teal);
  color: #ffffff;
  border-color: var(--color-teal);
}

.card-community .bottom-item {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 8px;
}

.post-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  white-space: nowrap;
}

.post-text {
  color: var(--color-slate);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --------------------------------------------------------------------------
   14. FOOTER (Sade ve Dengeli)
   -------------------------------------------------------------------------- */
.footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.footer-nav a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-slate);
  transition: color 0.15s ease;
}

.footer-nav a:hover {
  color: var(--color-teal);
}

.footer-copyright {
  font-size: 0.82rem;
  color: var(--color-muted);
}

/* --------------------------------------------------------------------------
   15. TAKEOVER DIALOG MODAL
   -------------------------------------------------------------------------- */
.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.dialog-backdrop[hidden] {
  display: none !important;
}

.dialog-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.dialog-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--color-navy);
}

.dialog-header h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
}

.dialog-text {
  font-size: 0.9rem;
  color: var(--color-slate);
  line-height: 1.5;
  margin-bottom: 20px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.dialog-actions .btn-secondary {
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  background: #f1ede4;
  color: var(--color-slate);
  font-weight: 600;
  cursor: pointer;
}

.dialog-actions .btn-primary {
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  background: var(--color-teal);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   16. RESPONSIVE FOUNDATIONS
   -------------------------------------------------------------------------- */
/* Mobile Buttons in Header (Hidden on Desktop) */
.mobile-search-btn,
.mobile-menu-btn {
  display: none;
}

.mobile-bottom-bar {
  display: none;
}

/* --------------------------------------------------------------------------
   16. RESPONSIVE FOUNDATIONS (DESKTOP, TABLET / LANDSCAPE, PORTRAIT MOBILE)
   -------------------------------------------------------------------------- */

/* TABLET & LANDSCAPE MOBILE (Home-reference-yatay.png) */
@media (max-width: 1199px) and (min-width: 769px) {
  .page-shell {
    width: 100%;
    max-width: 100%;
    padding: 0 14px 20px;
    box-sizing: border-box;
    overflow-x: hidden;
  }
  .topbar {
    margin-left: -14px;
    margin-right: -14px;
    padding: 0 14px;
  }
  .topbar-apps {
    display: none;
  }
  .layout-grid {
    grid-template-columns: 280px minmax(0, 1fr) 300px;
    gap: 10px;
  }
  .hero-slider-wrap {
    width: 100%;
    height: 220px;
  }
  .hero-headline {
    font-size: 1.55rem;
  }
  .card-rooms-wide {
    padding: 12px 14px;
  }
  .rooms-page {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }
  .game-thumb-wrap {
    height: 85px;
  }
  .bottom-cards-grid {
    gap: 10px;
    margin-top: 10px;
  }
}

/* PORTRAIT MOBILE (Home-reference-dikey.png) */
@media (max-width: 768px) {
  html, body {
    max-width: 100vw;
    overflow-x: hidden;
  }

  body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    background-color: #f8fafc;
  }

  .page-shell {
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
    padding: 0 10px 16px;
  }

  /* Header Mobile */
  .topbar {
    height: 54px;
    margin-left: -10px;
    margin-right: -10px;
    padding: 0 12px;
    box-sizing: border-box;
  }

  .nav-main,
  .topbar-socials,
  .topbar-apps,
  .search-box {
    display: none;
  }

  .topbar-right {
    gap: 8px;
  }

  .topbar-play-btn {
    padding: 6px 12px;
    font-size: 0.82rem;
    height: 34px;
  }

  .mobile-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    cursor: pointer;
  }

  .mobile-menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    cursor: pointer;
  }

  .mobile-menu-btn span {
    width: 18px;
    height: 2px;
    background: var(--color-navy);
    border-radius: 2px;
  }

  /* Main Grid Stack for Mobile: Controlled Layout */
  .layout-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
  }

  .col-left, .col-center, .col-right {
    display: contents;
  }

  .card {
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
  }

  #loginSection {
    order: 1;
    grid-column: 1 / -1;
    padding: 14px 16px;
    width: 100%;
  }

  #heroSlider {
    order: 2;
    grid-column: 1 / -1;
    width: 100%;
  }

  #games {
    order: 3;
    grid-column: 1 / -1;
    padding: 12px 14px;
    width: 100%;
  }

  /* Aktif Salonlar: Full width, slider holds 4x2 on page 1 without clipping */
  #roomsSection, .card-rooms-wide {
    order: 4;
    grid-column: 1 / -1;
    padding: 12px 14px;
    width: 100%;
  }

  /* En İyi Oyuncular: Full width so all player scores, crowns and avatars fit cleanly */
  #rankings, .card-ranking {
    order: 5;
    grid-column: 1 / -1;
    padding: 12px 14px;
    width: 100%;
  }

  /* Günün Görevi & Turnuva: Compact 2-column pairing */
  #dailyMission, .card-mission {
    order: 6;
    grid-column: 1 / 2;
    padding: 10px 10px;
  }

  #tournament, .card-tournament {
    order: 7;
    grid-column: 2 / 3;
    padding: 10px 10px;
  }

  .card-news {
    order: 8;
    grid-column: 1 / -1;
    padding: 12px 14px;
    width: 100%;
  }

  .hero-slider-wrap {
    width: 100%;
    height: 165px;
    border-radius: 12px;
  }

  .hero-headline {
    font-size: 1.3rem;
  }

  .hero-subline {
    font-size: 0.74rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .hero-cta-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  .rooms-page {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }

  .room-info-card {
    min-height: 42px;
    padding: 5px 6px;
  }

  .games-page {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }

  .game-thumb-wrap {
    height: 72px;
  }

  .game-name {
    font-size: 0.76rem;
  }

  .game-online {
    font-size: 0.66rem;
  }

  .bottom-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 10px;
    width: 100%;
    box-sizing: border-box;
  }

  .card-bottom {
    padding: 12px 14px;
    min-width: 0;
    overflow: hidden;
  }

  .card-winners {
    grid-column: 1 / 2;
  }

  .card-community {
    grid-column: 2 / 3;
  }

  .card-members {
    grid-column: 1 / -1;
  }

  /* Mobile Fixed Bottom Navigation Bar (dikey.png reference) */
  .mobile-bottom-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(54px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
    padding-left: 4px;
    padding-right: 4px;
  }

  .mob-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 4px;
    flex: 1;
    text-align: center;
    transition: color 0.15s ease;
  }

  .mob-nav-item svg {
    stroke: currentColor;
    opacity: 0.85;
  }

  .mob-nav-item.active {
    color: var(--color-teal);
    font-weight: 700;
  }

  .mob-nav-item.active svg {
    stroke: var(--color-teal);
    opacity: 1;
  }
}

/* ULTRA-NARROW SCREENS (<= 340px down to 272px) */
@media (max-width: 340px) {
  .page-shell {
    padding: 0 4px 16px;
  }

  .layout-grid {
    grid-template-columns: 1fr !important;
    gap: 8px;
  }

  #dailyMission, .card-mission,
  #tournament, .card-tournament,
  .card-winners, .card-community {
    grid-column: 1 / -1 !important;
  }

  .rooms-page {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .games-page {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .card-login {
    padding: 12px 8px;
  }

  .topbar {
    padding: 0 6px;
  }

  .topbar-play-btn {
    padding: 4px 8px;
    font-size: 0.74rem;
  }

  .trigger-room-name {
    max-width: 85px;
  }
}


/* STEP6_MOBILE_PORTRAIT_ALIGNMENT — desktop untouched */
@media (max-width: 768px) {
  body { min-width: 0; }
  .layout-grid { grid-auto-flow: row; align-items: start; }
  #loginSection { order: 1; grid-column: 1 / -1; }
  #heroSlider { order: 2; grid-column: 1 / -1; }
  #games { order: 3; grid-column: 1 / -1; }
  #rankings { order: 4; grid-column: 1 / 2; }
  #roomsSection { order: 5; grid-column: 2 / 3; }
  #dailyMission { order: 6; grid-column: 1 / 2; }
  #tournament { order: 7; grid-column: 2 / 3; }
  #newsSection { order: 8; grid-column: 1 / -1; }

  #rankings, #roomsSection, #dailyMission, #tournament { min-width: 0; width: 100%; }
  #rankings .card-header, #roomsSection .card-header, #dailyMission .card-header, #tournament .card-header {
    gap: 5px; margin-bottom: 8px; align-items: flex-start;
  }
  #rankings .card-header h3, #roomsSection .card-header h3, #dailyMission .card-header h3, #tournament .card-header h3 {
    font-size: .82rem; line-height: 1.15;
  }
  #rankings .ranking-filter-pills { gap: 1px; padding: 1px; }
  #rankings .pill-btn { padding: 3px 5px; font-size: .62rem; }
  #rankings .ranking-item { grid-template-columns: 16px 22px minmax(0,1fr) auto; gap: 4px; padding: 2px 0; }
  #rankings .user-avatar { width: 22px; height: 22px; }
  #rankings .user-nick { font-size: .69rem; }
  #rankings .user-score { font-size: .68rem; }

  #roomsSection .card-header-left { min-width: 0; gap: 4px; flex-wrap: wrap; }
  #roomsSection .online-pill-badge { font-size: .6rem; padding: 1px 5px; }
  #roomsSection .see-all-link { display: none; }
  #roomsSection .rooms-page-indicator { font-size: .64rem; }
  #roomsSection .rooms-nav-btn { width: 20px; height: 20px; font-size: .9rem; }
  #roomsSection .rooms-page { grid-template-columns: repeat(2, minmax(0,1fr)); grid-template-rows: repeat(4, auto); gap: 5px; }
  #roomsSection .room-info-card { min-height: 38px; padding: 4px 5px; }
  #roomsSection .ric-title { font-size: .62rem; }
  #roomsSection .ric-footer { font-size: .58rem; margin-top: 2px; }
  #roomsSection .ric-num { width: 15px; height: 15px; font-size: .56rem; }

  #dailyMission .mission-timer { padding: 2px 5px; font-size: .62rem; }
  #dailyMission .mission-desc { font-size: .67rem; margin-bottom: 7px; }
  #dailyMission .mission-status-box { gap: 6px; margin-bottom: 8px; align-items: stretch; }
  #dailyMission .mission-progress-wrap { gap: 5px; min-width: 0; }
  #dailyMission .progress-num { font-size: .65rem; }
  #dailyMission .mission-reward-badge { padding: 3px 5px; gap: 4px; }
  #dailyMission .mission-reward-badge img { width: 20px; height: 20px; }
  #dailyMission .reward-text strong { font-size: .72rem; }
  #dailyMission .reward-text small { font-size: .55rem; }
  #dailyMission .btn-mission-action { padding: 7px 5px; font-size: .72rem; }

  #tournament .see-all-link { display: none; }
  #tournament .tournaments-list { gap: 5px; }
  #tournament .tournament-item { padding: 5px; gap: 5px; }
  #tournament .tournament-trophy-box { width: 32px; height: 32px; }
  #tournament .trophy-img { width: 27px; height: 27px; }
  #tournament .tournament-name { font-size: .66rem; }
  #tournament .tournament-meta { font-size: .52rem; gap: 3px; white-space: normal; line-height: 1.15; }
  #tournament .tournament-prize { font-size: .58rem; }
  #tournament .tournament-action-arrow { width: 23px; height: 23px; }

  .bottom-cards-grid { align-items: start; }
  .card-winners, .card-community { min-width: 0; }
  .card-members { margin-top: 0; }
  .card-winners .bottom-item { grid-template-columns: 20px minmax(0,1fr) minmax(0,1fr); gap: 4px; }
  .card-winners .reward-val, .card-winners .time-ago { display: none; }
  .card-community .bottom-item { grid-template-columns: 20px minmax(0,1fr); gap: 4px; }
  .card-community .time-ago { display: none; }
  .card-bottom .card-header { margin-bottom: 8px; }
  .card-bottom .card-header h3 { font-size: .82rem; }
  .card-bottom .see-all-link { font-size: .65rem; }
  .bottom-list { gap: 7px; }

  .footer { display: none; }
}

@media (max-width: 420px) and (min-width: 341px) {
  .page-shell { padding-left: 6px; padding-right: 6px; }
  .layout-grid, .bottom-cards-grid { gap: 6px; }
  #rankings, #roomsSection, #dailyMission, #tournament { padding: 8px; }
  #roomsSection .online-pill-badge { display: none; }
}

@media (max-width: 340px) {
  body { min-width: 0; }
  .page-shell { width: 100%; max-width: 100vw; }
  .layout-grid { grid-template-columns: 1fr !important; }
  #rankings, #roomsSection, #dailyMission, #tournament, #newsSection { grid-column: 1 / -1 !important; }
  .bottom-cards-grid { grid-template-columns: 1fr !important; }
  .card-winners, .card-community, .card-members { grid-column: 1 / -1 !important; }
}


/* STEP7_MOBILE_BOTTOM_GRID — desktop untouched; removes portrait gaps */
@media (max-width: 768px) and (min-width: 341px) {
  .bottom-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto;
    grid-auto-flow: row;
    gap: 8px;
    align-items: stretch;
  }

  /* DOM order is winners, members, community. Place explicitly to avoid an empty grid cell. */
  .bottom-cards-grid .card-winners {
    grid-column: 1 / 2 !important;
    grid-row: 1;
    width: 100%;
    height: 100%;
  }

  .bottom-cards-grid .card-community {
    grid-column: 2 / 3 !important;
    grid-row: 1;
    width: 100%;
    height: 100%;
  }

  .bottom-cards-grid .card-members {
    grid-column: 1 / -1 !important;
    grid-row: 2;
    width: 100%;
    margin-top: 0 !important;
  }

  .bottom-cards-grid .card-bottom {
    min-width: 0;
    margin: 0;
  }

  .bottom-cards-grid .card-winners .bottom-list,
  .bottom-cards-grid .card-community .bottom-list {
    height: 100%;
    align-content: start;
  }
}

/* On very narrow phones, two columns become unreadable: use a clean, gap-free single stack. */
@media (max-width: 340px) {
  .bottom-cards-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: none !important;
    grid-auto-flow: row !important;
    gap: 7px !important;
    align-items: start !important;
  }

  .bottom-cards-grid .card-winners,
  .bottom-cards-grid .card-members,
  .bottom-cards-grid .card-community {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
  }
}

/* Target sync: keep the source layout readable on 769–1000px landscape/tablet widths. */
@media (min-width:769px) and (max-width:1000px){
  .topbar-inner{gap:8px}
  .topbar-socials,.search-box{display:none}
  .nav-item{padding:7px 6px;font-size:.78rem}
  .layout-grid{grid-template-columns:280px minmax(0,1fr);gap:10px}
  .col-right{grid-column:1/-1;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;align-items:start}
  .hero-slider-wrap{height:220px}
}

/* Keep verified landing content within the existing tournament card bounds. */
#tournament .tournament-meta{min-width:0;max-width:100%;overflow:hidden}
#tournament .tournament-meta span{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#btnSeeMission:disabled{opacity:.65;cursor:default}
#winners .user-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}


/* STEP8_MOBILE_BOTTOM_CONTENT_FIT — keep row pairing, let verified live rows define card height */
@media (max-width: 768px) and (min-width: 341px) {
  .bottom-cards-grid .card-winners,
  .bottom-cards-grid .card-community { height: auto; }
  .bottom-cards-grid .card-winners .bottom-list,
  .bottom-cards-grid .card-community .bottom-list { height: auto; }
}


/* Windows geçiş istemcisi — geçici download CTA */
.topbar-download-exe{display:inline-flex;align-items:center;justify-content:center;min-height:30px;padding:0 10px;border:1px solid rgba(255,255,255,.16);border-radius:7px;text-decoration:none;white-space:nowrap;font:600 11px/1.1 "Plus Jakarta Sans",sans-serif;color:inherit;background:rgba(255,255,255,.06)}
.topbar-download-exe:hover{background:rgba(255,255,255,.11)}
@media(max-width:1180px){.topbar-download-exe{padding:0 8px;font-size:10px}}
