/* ========================================================= */
/* =================== RESPONSIVE BLOK ====================== */
/* ========================================================= */

/* 1024 altı: grid 2 kolon, hero hala 2 kolon */
@media (max-width: 1024px) {
  .tc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tc-grid-2col {
    grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.9fr);
  }
}

/* 900 altı: hero tek kolon, genel padding sıkışsın */

@media (max-width: 900px) {
  body.tc-body {
    align-items: stretch;
  }

  .tc-container {
    padding: 24px 16px 28px;
  }

  .tc-hero {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 28px;
  }

  .tc-hero-left {
    order: 1;
  }

  .tc-hero-right {
    order: 2;
    justify-content: center;
  }

  .tc-hero-preview {
    max-width: 420px;
    margin: 0 auto;
  }

  .tc-tier-card,
  .tc-form-card,
  .tc-poll-card,
  .tc-rp-input-card,
  .tc-rp-wheel-card {
    padding: 18px 14px 16px;
    gap: 10px;
  }

  .tc-grid-2col {
    grid-template-columns: 1fr;
  }

  .tier-row {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .tier-label {
    min-width: 100%;
    justify-content: flex-start;
    font-size: 13px;
    padding: 6px 10px;
  }

  .tier-drop,
  .tier-items-pool {
    min-height: 64px;
    padding: 6px;
  }

  .tier-items-pool {
    gap: 6px;
  }

  .tier-item {
    max-width: calc(50% - 5px);
    max-height: none;
  }

  .tier-item img {
    width: 100%;
    height: auto;
    object-fit: contain;
  }

  .tc-rp-layout {
    grid-template-columns: 1fr;
    gap: 18px;
    margin-top: 16px;
  }

  .tc-rp-wheel-wrap {
    max-width: 420px;
    margin: 16px auto 0;
  }

  .tc-rp-spin-btn {
    max-width: 260px;
    width: 100%;
  }

  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }
}

/* 768 altı: poll & form özel düzenler */

@media (max-width: 768px) {
  .tc-poll-card {
    padding: 18px 12px 14px;
    border-radius: 22px;
  }

  .pr-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .pr-btn,
  .pr-select {
    font-size: 11px;
  }

  .pr-chart-card {
    padding: 10px;
  }

  .fr-card {
    padding: 18px 12px 14px;
    border-radius: 22px;
  }
}

/* 640 altı: grid 1 kolon, hero yazı küçülsün, header nefes */

@media (max-width: 640px) {
  .tc-container {
    padding: 20px 12px 22px;
  }

  .tc-header {
    margin-bottom: 20px;
    padding-right: 64px; /* theme toggle çarpışmasın */
  }

  .tc-logo {
    font-size: 22px;
  }

  .tc-sub {
    font-size: 12px;
  }

  .tc-hero-title {
    font-size: 24px;
    line-height: 1.2;
  }

  .tc-hero-sub {
    font-size: 13px;
    max-width: none;
  }

  .tc-hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .tc-hero-primary,
  .tc-hero-secondary {
    width: 100%;
    justify-content: center;
  }

  .tc-hero-meta {
    font-size: 10px;
  }

  .tc-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .tc-card {
    padding: 18px 14px 16px;
    min-height: auto;
  }

  .tc-card h2 {
    font-size: 16px;
  }

  .tc-card p {
    font-size: 13px;
  }

  .giphy-thumb-wrap {
    flex: 0 0 calc(50% - 6px);
    border-radius: 7px;
  }

  .giphy-thumb-label {
    font-size: 8px;
  }

  .giphy-modal-inner {
    width: 94vw;
    padding: 10px 10px 8px;
    border-radius: var(--radius-md);
  }

  .tc-rp-input-card {
    align-items: stretch;
    gap: 8px;
  }

  .tc-rp-wheel-card {
    align-items: center;
    gap: 8px;
    text-align: center;
  }

  .tc-rp-textarea {
    min-height: 150px;
    font-size: 12px;
  }

  .tc-rp-actions {
    gap: 6px;
  }

  .tc-footer {
    margin-top: 20px;
  }

  .tc-footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

/* 480 altı: toolbar ve butonlar full width, hero kompakt */

@media (max-width: 480px) {
  .pr-toolbar,
  .fr-toolbar,
  .tc-rp-actions,
  .tier-upload-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .pr-toolbar-left,
  .pr-toolbar-right,
  .fr-toolbar-left,
  .fr-toolbar-right {
    width: 100%;
    justify-content: flex-start;
  }

  .pr-btn,
  .fr-view-btn,
  .fr-export-btn,
  .fr-clear-btn,
  .tc-btn-primary,
  .tc-btn-outline,
  .tc-btn-ghost {
    width: 100%;
    justify-content: center;
  }

  .tc-hero-title {
    font-size: 22px;
  }

  .tc-hero-sub {
    font-size: 12px;
  }

  .tc-container {
    padding: 16px 10px 20px;
  }

  .tc-hero {
    margin-bottom: 20px;
  }

  .tc-hero-pill-row {
    gap: 4px;
  }

  .tc-hero-pill {
    font-size: 10px;
    padding: 3px 8px;
  }

  .tc-rp-wheel-wrap {
    max-width: 360px;
    margin: 12px auto 0;
  }

  .giphy-search-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  .giphy-search-input {
    width: 100%;
  }

  .giphy-search-btn {
    width: 100%;
    justify-content: center;
  }
}

/* 400 altı: ufak tipografi / gölge ayarları */

@media (max-width: 400px) {
  .tc-container {
    padding: 14px 8px 18px;
  }

  .tc-logo {
    font-size: 20px;
  }

  .tier-item {
    max-width: calc(50% - 5px);
    max-height: none;
  }

  .tier-label {
    font-size: 12px;
    padding: 5px 8px;
  }

  .tc-result {
    font-size: 11px;
  }

  .tc-rp-winner {
    font-size: 16px;
  }

  .tc-rp-label {
    font-size: 8px;
  }

  .tc-rp-footnote {
    font-size: 8px;
  }
}

/* RANDOM PICKER — Mobil Fix */
@media (max-width: 640px) {
  .tc-rp-layout {
    grid-template-columns: 1fr !important;
    gap: 18px !important;
    margin-top: 16px !important;
  }

  .tc-rp-input-card,
  .tc-rp-wheel-card {
    width: 100% !important;
    padding: 16px 12px !important;
    border-radius: 18px !important;
  }

  .tc-rp-wheel-wrap {
    max-width: 380px !important;
    margin: 0 auto !important;
  }

  .tc-rp-spin-btn {
    width: 100% !important;
    max-width: 260px !important;
    margin: 0 auto !important;
  }
}

/* Vampir Köylü: oda yokken sol kartı ortaya alın */
#vk-main-grid.vk-no-room {
  display: flex;
  justify-content: center;
}

#vk-main-grid.vk-no-room > .tc-tier-card {
  max-width: auto;
  width: 100%;
}