/* ═══════════════════════════════════════════
   KYTHIK HUB — styles.css
   ═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,700&display=swap');

/* ── TOKENS ─────────────────────────────── */
:root {
  --bg:            #09090e;
  --surface:       #111118;
  --surface-2:     #17171f;
  --surface-3:     #1e1e28;
  --border:        rgba(245, 166, 35, 0.1);
  --border-hover:  rgba(245, 166, 35, 0.35);
  --accent:        #f5a623;
  --accent-dim:    rgba(245, 166, 35, 0.08);
  --accent-glow:   rgba(245, 166, 35, 0.2);
  --text:          #e0e0ee;
  --text-dim:      #7a7a9a;
  --text-muted:    #44445a;
  --green:         #4ec97e;
  --red:           #e05252;
  --twitch:        #9147ff;
  --discord:       #7289da;
  --font-display:  'Cinzel', serif;
  --font-body:     'DM Sans', sans-serif;
  --radius-sm:     4px;
  --radius:        8px;
  --radius-lg:     12px;
  --transition:    0.2s ease;
}

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

/* ── BASE ───────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: var(--font-body); }

/* ── LAYOUT ─────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 40px 0; }
.section--flush { padding: 0; }

/* ── TYPOGRAPHY ─────────────────────────── */
.display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.display--lg { font-size: 28px; }
.display--md { font-size: 22px; }
.display--sm { font-size: 16px; }

.display .accent { color: var(--accent); }

.subtext {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ── STREAM SECTION ─────────────────────── */
.stream-section {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.stream-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  align-items: start;
  padding: 32px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Twitch player container */
.twitch-wrap {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
}

.twitch-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Live pill */
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e91916;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}

.live-pill--vod {
  background: var(--surface-3);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.live-dot {
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.25; }
}

/* Channel info sidebar */
.channel-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.channel-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.channel-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: -4px;
}

.twitch-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--twitch);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 5px;
  border: none;
  text-decoration: none;
  transition: background var(--transition), transform var(--transition);
  width: fit-content;
  margin-top: 8px;
}

.twitch-btn:hover {
  background: #7b2ee0;
  transform: translateY(-1px);
}

/* ── DATABASE HEADER ────────────────────── */
.db-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 44px 24px 0;
  max-width: 1200px;
  margin: 0 auto;
}

.db-count {
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  white-space: nowrap;
}

/* ── FILTERS ────────────────────────────── */
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding: 18px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.search {
  flex: 1;
  min-width: 200px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
}

.search::placeholder { color: var(--text-muted); }
.search:focus { border-color: var(--accent); }

.pill {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 7px 14px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  transition: all 0.15s;
  white-space: nowrap;
}

.pill:hover,
.pill.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── STRATEGY GRID ──────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
  padding: 4px 24px 40px;
  max-width: 1200px;
  margin: 0 auto;
}

/* ── STRATEGY CARD ──────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.25s;
}

.card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 10px 40px rgba(0,0,0,0.5), 0 0 0 1px var(--accent-glow);
}

.card:hover::after { opacity: 1; }

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.card-tags { display: flex; flex-wrap: wrap; gap: 5px; }

.tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.tag--game,
.tag--channel {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(245, 166, 35, 0.2);
}

.card-date {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.card-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  letter-spacing: 0.01em;
  margin-bottom: 10px;
}

.card-body {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.65;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  gap: 8px;
}

.author {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-muted);
}

.avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid rgba(245, 166, 35, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

.discord-link {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color var(--transition);
  white-space: nowrap;
}

.discord-link:hover { color: var(--discord); }

/* ── SKELETON ───────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-2) 25%,
    var(--surface-3) 50%,
    var(--surface-2) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── EMPTY / ERROR STATE ────────────────── */
.state-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 0;
  color: var(--text-muted);
  font-size: 14px;
}

.state-empty__icon {
  font-size: 36px;
  margin-bottom: 12px;
  opacity: 0.4;
}

/* ── DIVIDER ────────────────────────────── */
.divider {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  border-top: 1px solid var(--border);
}

/* ── SUBMIT FORM ────────────────────────── */
.submit-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

.submit-header { margin-bottom: 22px; }
.submit-header h2 { margin-bottom: 6px; }

.form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group--full { grid-column: 1 / -1; }

.form-group label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.required { color: var(--accent); margin-left: 2px; }

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
  width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--accent); }

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-muted); }

.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234a4a6a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.form-group select option { background: var(--surface-2); }
.form-group textarea { min-height: 130px; resize: vertical; line-height: 1.6; }

.submit-btn {
  grid-column: 1 / -1;
  background: var(--accent);
  color: #09090e;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius);
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.submit-btn:hover {
  background: #ffc145;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px var(--accent-glow);
}

.submit-btn:active { transform: translateY(0); }

.submit-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── TOAST ──────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 13px;
  color: var(--text);
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  z-index: 9999;
  max-width: 320px;
  transform: translateY(60px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast.show   { transform: translateY(0); opacity: 1; }
.toast.success { border-color: var(--green); color: var(--green); }
.toast.error   { border-color: var(--red);   color: var(--red); }

/* ── FOOTER ─────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 18px 24px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.footer a { color: var(--discord); }
.footer a:hover { text-decoration: underline; }

/* ── RESPONSIVE ─────────────────────────── */
@media (max-width: 860px) {
  .stream-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .grid                { grid-template-columns: 1fr; }
  .form                { grid-template-columns: 1fr; }
  .form-group--full,
  .submit-btn          { grid-column: 1; }
  .display--lg         { font-size: 20px; }
  .db-header           { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ── CARD THUMBNAIL ─────────────────────── */
.card-thumb {
  width: 100%;
  height: 160px;
  overflow: hidden;
  border-radius: 8px 8px 0 0;
  margin: -20px -20px 16px;
  width: calc(100% + 40px);
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.card-inner { position: relative; }

/* ── TAG FILTER ROW ─────────────────────── */
.tag-filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 24px 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.pill--tag {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.pill--tag:hover,
.pill--tag.active {
  background: var(--surface-3);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── VOTES ──────────────────────────────── */
.votes {
  display: flex;
  align-items: center;
  gap: 6px;
}

.votes--inline {
  margin-left: auto;
}

.vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-body);
}

.vote-btn:hover { border-color: var(--text-dim); color: var(--text-dim); }

.vote-btn--up.active  {
  background: rgba(78, 201, 126, 0.1);
  border-color: var(--green);
  color: var(--green);
}

.vote-btn--down.active {
  background: rgba(224, 82, 82, 0.1);
  border-color: var(--red);
  color: var(--red);
}

/* ── MODAL ──────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 720px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.25s ease;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.modal-close {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 14px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}

.modal-close:hover { border-color: var(--accent); color: var(--accent); }

.modal-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 12px;
}

.modal-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.modal-body {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.75;
  margin-bottom: 24px;
  white-space: pre-wrap;
}

.modal-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.modal-images a { display: block; border-radius: var(--radius); overflow: hidden; }

.modal-images img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  transition: transform 0.2s;
}

.modal-images img:hover { transform: scale(1.02); }

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  gap: 12px;
}

.modal-discord-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--discord);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 5px;
  transition: background 0.2s, transform 0.15s;
}

.modal-discord-btn:hover { background: #5f73bc; transform: translateY(-1px); }

@media (max-width: 600px) {
  .modal { padding: 20px; }
  .modal-title { font-size: 18px; }
  .modal-images { grid-template-columns: 1fr; }
}

/* ── COMMENT COUNT ──────────────────────── */
.comment-count {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  transition: color var(--transition);
  white-space: nowrap;
}

.comment-count:hover { color: var(--discord); }

.card-foot-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
