/*
Theme Name: CornTubez
Theme URI: https://example.com/corntubez
Author: CornTubez
Description: Dark tube layout with 18+ age gate, media grid, and optional live-chat popup. Upload photos or videos on posts.
Version: 1.3.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: corntubez
*/

:root {
  --bg: #0a0a0a;
  --text: #f4f4f4;
  --muted: #9a9a9a;
  --orange: #ff8a00;
  --green: #2ecc71;
  --max: 1280px;
}
* { box-sizing: border-box; }
html, body { background: var(--bg); color: var(--text); font-family: Inter, system-ui, sans-serif; margin: 0; min-height: 100%; }
a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; height: auto; }
.wrap { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }
.gate { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.78); display: grid; place-items: center; backdrop-filter: blur(10px); }
.gate.hidden { display: none; }
.gate-card { width: min(420px, calc(100% - 32px)); background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 16px; padding: 36px 28px 22px; text-align: center; }
.logo { font-weight: 800; font-size: 28px; letter-spacing: -0.04em; color: #fff; }
.logo span { background: var(--orange); color: #111; padding: 0 6px; border-radius: 4px; margin-left: 2px; }
.badge-18 { width: 72px; height: 72px; margin: 22px auto 16px; border: 3px solid var(--orange); border-radius: 50%; display: grid; place-items: center; color: var(--orange); font-weight: 800; font-size: 22px; }
.gate-card h2 { font-size: 22px; margin: 0 0 10px; }
.gate-card p { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; background: var(--orange); color: #111; font-weight: 700; border: 0; border-radius: 10px; padding: 14px 18px; width: 100%; cursor: pointer; font-size: 15px; margin-top: 20px; }
.btn.ghost { background: transparent; color: #888; margin-top: 8px; }
.header { position: sticky; top: 0; z-index: 40; background: #0b0b0b; border-bottom: 1px solid #1c1c1c; }
.header-inner { display: flex; align-items: center; gap: 18px; height: 72px; }
.search { flex: 1; display: flex; align-items: center; background: #161616; border: 1px solid #262626; border-radius: 999px; padding: 8px 16px; }
.search input { flex: 1; background: transparent; border: 0; outline: 0; color: #fff; font-size: 14px; width: 100%; }
.section { padding: 28px 0 48px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 18px; }
.section-head h1 { font-size: 26px; margin: 0; }
.section-head p { color: var(--muted); font-size: 14px; margin: 4px 0 0; }
.counter { background: #1d1d1d; color: #ccc; font-size: 12px; padding: 6px 10px; border-radius: 999px; }
.grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px 14px; }
.card .thumb { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 16/10; background: #222; }
.card .thumb img, .card .thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb .ph { width: 100%; height: 100%; background: linear-gradient(135deg, #2a2a2a, #151515 40%, #2e220f); }
.hd, .dur { position: absolute; font-size: 11px; font-weight: 800; padding: 3px 6px; border-radius: 4px; }
.hd { top: 8px; left: 8px; background: var(--orange); color: #111; }
.dur { right: 8px; bottom: 8px; background: rgba(0,0,0,.75); }
.card h3 { font-size: 14px; line-height: 1.35; margin: 10px 0 8px; font-weight: 650; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; color: #8d8d8d; font-size: 12px; }
.ok { color: var(--green); font-weight: 700; }
.pager { display: flex; justify-content: center; gap: 10px; margin-top: 28px; }
.page-numbers { min-width: 44px; height: 40px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: #1a1a1a; border: 1px solid #2a2a2a; color: #ddd; font-weight: 600; }
.footer { border-top: 1px solid #1c1c1c; padding: 28px 0 40px; color: #777; font-size: 13px; }
.player { background: #111; border-radius: 14px; overflow: hidden; aspect-ratio: 16/9; display: grid; place-items: center; color: #666; border: 1px solid #222; margin-bottom: 16px; }
.player video, .player img { width: 100%; height: 100%; object-fit: contain; background: #000; }
.cam { position: fixed; right: 18px; bottom: 18px; z-index: 70; width: 68px; height: 68px; border-radius: 50%; border: 3px solid var(--orange); overflow: hidden; background: #333; cursor: pointer; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.cam img { width: 100%; height: 100%; object-fit: cover; }
.cam .dot { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; background: #e74c3c; color: #fff; border-radius: 50%; font-size: 10px; display: grid; place-items: center; font-weight: 800; border: 2px solid #0a0a0a; }
.cam-panel { position: fixed; right: 18px; bottom: 100px; z-index: 70; width: min(340px, calc(100% - 24px)); background: #141414; border: 1px solid #2a2a2a; border-radius: 18px; padding: 20px; display: none; box-shadow: 0 16px 50px rgba(0,0,0,.55); }
.cam-panel.open { display: block; }
.cam-panel h4 { margin: 0 0 8px; font-size: 18px; }
.cam-panel p { color: #bbb; font-size: 14px; line-height: 1.5; margin: 0 0 8px; }
.cam-panel .btn { margin-top: 12px; }
.empty-help { grid-column: 1 / -1; background: #141414; border: 1px dashed #333; border-radius: 14px; padding: 28px; color: #aaa; line-height: 1.6; }
.empty-help strong { color: #fff; }
@media (max-width: 1100px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .grid { grid-template-columns: repeat(2, 1fr); } .header-inner { height: auto; padding: 12px 0; flex-wrap: wrap; } }


.unlock-overlay {
  position: fixed; inset: 0; z-index: 85;
  background: rgba(0,0,0,.72);
  display: grid; place-items: center;
  padding: 16px;
  backdrop-filter: blur(8px);
}
.unlock-overlay.hidden { display: none !important; }
.unlock-card {
  width: min(460px, 100%);
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 18px;
  padding: 32px 28px 24px;
  text-align: center;
  position: relative;
}
.unlock-x {
  position: absolute; top: 12px; right: 14px;
  background: none; border: 0; color: #888; font-size: 22px; cursor: pointer;
}
.unlock-lock {
  width: 56px; height: 56px; margin: 0 auto 16px;
  border: 2px solid #ff8a00; border-radius: 14px;
  display: grid; place-items: center;
}
.unlock-card h2 { margin: 0 0 10px; font-size: 24px; }
.unlock-title { color: #ff8a00; font-weight: 700; font-size: 15px; line-height: 1.4; margin: 0 0 14px; }
.unlock-copy { color: #9a9a9a; font-size: 14px; line-height: 1.55; margin: 0 0 20px; }
.unlock-actions { display: flex; gap: 10px; }
.unlock-actions .btn { margin-top: 0; width: auto; flex: 1; }
.btn.ghost-outline {
  background: transparent; color: #fff;
  border: 1px solid #3a3a3a;
}
