
:root{
  --theme: #0B5FFF;
  /* Light, lively palette */
  --bg: #f3f6ff;          /* light blue */
  --text: #0f172a;
  --muted: #475569;
  --card: #fff;
  --border: #dbe3f1;
  --game-bg: #ffffff;

  --soft-blue:#dbeafe;
  --soft-red:#ffe4e6;
  --soft-gray:#f1f5f9;
  --soft-green:#dcfce7;
}
html,body{margin:0;padding:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;background:var(--bg);color:var(--text);}
.katy-app-body{margin:0;padding:0;}
.katy-app-root{max-width:100%;}

.katy-splash{
  position:fixed;inset:0;background:#fff;display:flex;align-items:center;justify-content:center;z-index:9999;
}
.katy-splash.hidden{display:none;}
.katy-splash-inner{text-align:center;}
.katy-splash-logo{width:92px;height:92px;border-radius:24px;box-shadow:0 10px 30px rgba(0,0,0,.12);}
.katy-splash-title{font-size:20px;margin-top:14px;font-weight:700;}
.katy-splash-dots{display:flex;gap:6px;justify-content:center;margin-top:14px;}
.katy-splash-dots span{width:8px;height:8px;border-radius:50%;background:var(--theme);opacity:.2;animation:katyDot 1s infinite;}
.katy-splash-dots span:nth-child(2){animation-delay:.15s;}
.katy-splash-dots span:nth-child(3){animation-delay:.3s;}
@keyframes katyDot{0%,100%{opacity:.2;transform:translateY(0)}50%{opacity:1;transform:translateY(-3px)}}

.topbar{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;border-bottom:1px solid var(--border);position:sticky;top:0;background:rgba(255,255,255,.92);backdrop-filter:saturate(180%) blur(10px);z-index:10;}
.brand{display:flex;align-items:center;gap:10px;font-weight:800;font-size:18px;}
.brand-logo{width:34px;height:34px;border-radius:10px;object-fit:cover;box-shadow:0 6px 18px rgba(15,23,42,0.10);}
.brand-text{display:none;}
@media(min-width:520px){.brand-text{display:inline;}}
.top-actions{display:flex;gap:8px;align-items:center;}
button{font:inherit;border:1px solid var(--border);background:#fff;border-radius:12px;padding:8px 12px;cursor:pointer;box-shadow:0 1px 0 rgba(15,23,42,.04);}
button.primary{background:var(--theme);color:#fff;border-color:var(--theme);}
button.success{background:#16a34a;color:#fff;border-color:#16a34a;}
button.danger{background:#dc2626;color:#fff;border-color:#dc2626;}
button.ghost{background:#fff;}
button:disabled{opacity:.5;cursor:not-allowed;}

/* Allow links to look like buttons when used for in-app actions */
a.primary, a.success, a.danger, a.ghost{display:inline-flex;align-items:center;justify-content:center;font:inherit;border:1px solid var(--border);background:#fff;border-radius:12px;padding:8px 12px;cursor:pointer;box-shadow:0 1px 0 rgba(15,23,42,.04);text-decoration:none;}
a.primary{background:var(--theme);color:#fff;border-color:var(--theme);}
a.success{background:#16a34a;color:#fff;border-color:#16a34a;}
a.danger{background:#dc2626;color:#fff;border-color:#dc2626;}

.chat-btn{padding:8px 10px;border-radius:999px;font-weight:700;}
.chat-btn.green{background:#d1fae5;border-color:#10b981;color:#065f46;}
.chat-btn.blue{background:#dbeafe;border-color:#2563eb;color:#1e40af;}

.nav{display:flex;gap:10px;overflow:auto;padding:10px 12px;border-bottom:1px solid var(--border);background:rgba(255,255,255,.92);backdrop-filter:saturate(180%) blur(10px);}
.nav a{padding:8px 12px;border-radius:999px;text-decoration:none;color:#1f2937;border:1px solid transparent;white-space:nowrap;}
.nav a.active{border-color:var(--border);background:var(--soft-blue);font-weight:700;}
.nav a.alert{background:#fee2e2;border-color:#fecaca;color:#991b1b;font-weight:800;}
.nav a .badge-dot{display:inline-block;min-width:18px;height:18px;line-height:18px;text-align:center;border-radius:999px;background:#dc2626;color:#fff;font-size:12px;margin-left:6px;padding:0 6px;}

/* Icon menu mode */
.katy-menu-icons .nav a{display:flex;align-items:center;justify-content:center;gap:6px;}
.katy-menu-icons .nav a .nav-icon{width:22px;height:22px;display:block;}
.katy-menu-icons .nav a .nav-icon-fallback{width:22px;height:22px;border-radius:6px;background:#e5e7eb;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:12px;}
.katy-menu-icons-only .nav a{padding:8px;min-width:44px;height:44px;border-radius:14px;}
.katy-menu-icons-only .nav a .nav-label{display:none;}
.katy-menu-icons-both .nav a{flex-direction:column;min-width:70px;border-radius:14px;}
.katy-menu-icons-both .nav a .nav-label{font-size:11px;line-height:1.1;}

/* badges in icon mode */
.katy-menu-icons .nav a{position:relative;}
.katy-menu-icons .nav a .badge-dot{position:absolute;top:2px;right:2px;margin-left:0;}

/* Clickable username links */
.link{cursor:pointer;text-decoration:underline;text-underline-offset:2px;}

.tag-chips{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px;margin-bottom:6px;}
.tag-chip{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--border);border-radius:999px;padding:4px 10px;font-size:12px;background:#fff;}
.tag-chip button{padding:2px 6px;border-radius:999px;}

.player-row{display:flex;gap:10px;flex-wrap:wrap;align-items:center;}
.player-chip{display:flex;align-items:center;gap:8px;border:1px solid var(--border);border-radius:999px;padding:6px 10px;background:#fff;}
.player-chip img{width:22px;height:22px;border-radius:999px;}
.player-chip .dot{width:10px;height:10px;border-radius:999px;background:#9ca3af;}
.player-chip.online .dot{background:#10b981;}
.player-chip.ready{border-color:#10b981;}

.match-layout{display:grid;grid-template-columns:1fr;gap:12px;}
@media(min-width:900px){.match-layout{grid-template-columns:1fr 340px;}}
.match-chat{position:sticky;top:120px;}

.container{padding:12px;max-width:1100px;margin:0 auto;}
.notice{padding:12px;border:1px solid var(--border);border-radius:16px;background:linear-gradient(180deg, rgba(255,255,255,.97), rgba(241,245,249,.9));margin-bottom:10px;}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:12px;}
.auction-grid{grid-template-columns:repeat(auto-fill,minmax(340px,1fr));}
.card{border:1px solid var(--border);border-radius:16px;background:var(--card);overflow:hidden;display:flex;flex-direction:column;}
.card img{width:100%;height:160px;object-fit:cover;background:#f3f4f6;}

/* Auction list images were appearing overly large; lock auction cards to a smaller fixed height. */
.auction-card .card-img{width:100%;height:120px;overflow:hidden;background:#f3f4f6;}
.auction-card .card-img:empty{display:none;}
.auction-card .card-img img{width:100%;height:120px;object-fit:cover;display:block;}
.auction-card button{padding:10px 16px;}
.auction-detail .card-img{width:100%;height:220px;overflow:hidden;background:#f3f4f6;border-radius:16px;}
.auction-detail .card-img img{width:100%;height:220px;object-fit:contain;display:block;}
.card .pad{padding:10px 12px;}
.card .title{font-weight:800;font-size:16px;line-height:1.25;margin:0 0 6px 0;}
.card .meta{color:var(--muted);font-size:13px;}

/* Raffle tickets */
.notice.raffle-intro{background:#EAF8E8;border-color:#BFE6B8;}
.card.raffle-ticket{background:#EAF8E8;border-color:#BFE6B8;}
.card.raffle-ticket .pill{background:#D6F3D2;}
.badges{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px;}
.badge{border:1px solid var(--border);border-radius:999px;padding:4px 10px;font-size:12px;font-weight:800;background:#fff;}
.badge.free{background:#f3f4f6;}
.badge.basic{background:#fff7ed;border-color:#fdba74;}
.badge.premium{background:#ecfeff;border-color:#67e8f9;}
.badge.pinned{background:#fef3c7;border-color:#fbbf24;}
.badge.featured{background:#ede9fe;border-color:#a78bfa;}
.row{display:flex;gap:10px;flex-wrap:wrap;align-items:center;}
.row input, .row select, textarea{border:1px solid var(--border);border-radius:10px;padding:8px 10px;font:inherit;}
.row input{min-width:200px;}

input[type="checkbox"]{width:18px;height:18px;accent-color:var(--theme);}

.check{display:inline-flex;align-items:center;gap:10px;padding:10px 12px;border-radius:14px;border:1px solid var(--border);background:#f8fafc;font-weight:600;}
.check span{color:var(--muted);font-weight:600;}

.pill{border:1px solid var(--border);background:#f8fafc;border-radius:999px;padding:8px 12px;font-weight:800;color:#334155;}
.pill.selected{background:var(--theme);border-color:var(--theme);color:#fff;}

a.btn{display:inline-block;text-decoration:none;border:1px solid var(--theme);background:var(--theme);color:#fff;border-radius:12px;padding:8px 12px;font-weight:800;}
a.btn:active{transform:translateY(1px);}
textarea{width:100%;min-height:90px;}

.detail-header{display:flex;gap:10px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin-bottom:10px;}
.detail-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;}
.detail-title{font-size:22px;font-weight:900;margin:8px 0;}
.detail-content{line-height:1.5;}
.detail-content img{max-width:100%;height:auto;border-radius:12px;}
hr{border:0;border-top:1px solid var(--border);margin:14px 0;}

.update-banner{position:fixed;bottom:14px;left:14px;right:14px;max-width:700px;margin:0 auto;background:#111827;color:#fff;border-radius:14px;padding:10px 12px;display:flex;justify-content:space-between;align-items:center;gap:10px;z-index:999;}
.update-banner.hidden{display:none;}
.update-banner button{background:#fff;color:#111;border-color:#fff;}

.tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:10px;}
.tabs button{border-radius:999px;}
.tabs button.active{background:#f3f4f6;font-weight:800;}

.small{font-size:12px;color:var(--muted);}
.katy-lock{padding:12px;border:1px solid var(--border);border-radius:14px;background:#fff;}
.katy-lock strong{display:block;margin-bottom:6px;}

.game-wrap{background:var(--game-bg);border:1px solid var(--border);border-radius:16px;padding:12px;}
.game-board{display:grid;gap:6px;margin-top:10px;}
.game-cell{width:64px;height:64px;border:1px solid var(--border);border-radius:12px;display:flex;align-items:center;justify-content:center;font-size:30px;font-weight:900;background:#fff;cursor:pointer;}
.game-cell.disabled{opacity:.6;cursor:not-allowed;}
.game-row{display:flex;gap:6px;}

.chat-panel{border:1px solid var(--border);border-radius:16px;overflow:hidden;background:#fff;}
.chat-messages{padding:12px;max-height:55vh;overflow:auto;display:flex;flex-direction:column;gap:8px;}
.msg{max-width:78%;padding:8px 10px;border-radius:14px;border:1px solid var(--border);background:#f9fafb;}
.msg.me{margin-left:auto;background:#eff6ff;border-color:#bfdbfe;}
.msg .who{font-size:12px;font-weight:800;color:#374151;margin-bottom:3px;}
.msg .time{font-size:11px;color:var(--muted);margin-top:3px;}
.chat-input{display:flex;gap:8px;padding:10px;border-top:1px solid var(--border);}
.chat-input input{flex:1;min-width:0;}
.emoji-bar{display:flex;gap:6px;flex-wrap:wrap;padding:0 10px 10px;}
.emoji-bar button{padding:6px 8px;border-radius:10px;}


.avatar{width:28px;height:28px;border-radius:999px;object-fit:cover;border:1px solid #e5e7eb;}
.player-chip{display:flex;align-items:center;gap:8px;border:1px solid #e5e7eb;border-radius:999px;padding:6px 10px;background:#fff;}
.player-chip .dot{width:10px;height:10px;border-radius:999px;background:#9ca3af;display:inline-block;}
.player-chip .dot.online{background:#10b981;}
.player-chip .dot.ready{background:#3b82f6;}
.match-layout{display:grid;grid-template-columns:1fr;gap:12px;}
@media (min-width:900px){.match-layout{grid-template-columns:2fr 1fr;}}
.match-chat{min-height:220px;}

/* Mobile-friendly bottom navigation */
@media (max-width: 780px){
  .nav{
    position:fixed;
    left:0;right:0;bottom:0;
    top:auto;
    border-bottom:none;
    border-top:1px solid var(--border);
    z-index:50;
  }
  .container{padding-bottom:92px;}
  .footer{display:none;}
}

/* Force menu placement (admin-configurable) */
.katy-nav-top .nav{position:sticky;top:52px;left:auto;right:auto;bottom:auto;border-top:none;border-bottom:1px solid var(--border);} 
.katy-nav-top .container{padding-bottom:20px;}

.katy-nav-bottom .nav{position:fixed;left:0;right:0;bottom:0;top:auto;border-bottom:none;border-top:1px solid var(--border);z-index:50;}
.katy-nav-bottom .container{padding-bottom:92px;}
.katy-nav-bottom .footer{display:none;}



/* Advertisement-style marketing cards */
.ad-card{
  border:1px solid var(--border);
  border-radius:18px;
  background:var(--card);
  overflow:hidden;
  box-shadow: 0 6px 18px rgba(15,23,42,0.06);
}
.ad-top{position:relative;}
.ad-badge{
  position:absolute;
  top:10px;left:10px;
  background: rgba(11,95,255,0.92);
  color:#fff;
  font-size:12px;
  padding:4px 10px;
  border-radius:999px;
  font-weight:700;
}
.ad-img{width:100%;height:180px;object-fit:cover;display:block;background:#eef2ff;}
.ad-img.ph{height:120px;}
.ad-body{padding:14px 16px;}
.ad-title{font-weight:900;font-size:18px;line-height:1.15;margin-bottom:6px;}
.ad-text{color:var(--muted);font-size:14px;line-height:1.4;}
.ad-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px;align-items:center;}
.btn.ghost{background:transparent;border:1px solid var(--border);}

/* Scan store buttons */
.store-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap:8px;
}
.store-btn{
  border:1px solid var(--border);
  background:var(--card);
  padding:10px 12px;
  border-radius:14px;
  font-weight:700;
}
.store-btn:hover{transform:translateY(-1px);}

/* Auction */
.auction-card{background:linear-gradient(180deg, var(--card) 0%, rgba(219,234,254,0.35) 100%);} /* soft-blue */
.auction-card .meta .pill{background:var(--soft-gray);}
.auction-detail .auction-bidbox{margin-top:14px;padding:12px;border-radius:16px;border:1px dashed var(--border);background:rgba(241,245,249,0.8);} /* soft-gray */
.auction-detail .content{margin-top:12px;}
.table{width:100%;border-collapse:collapse;}
.table th,.table td{border-bottom:1px solid var(--border);padding:10px 8px;text-align:left;font-size:14px;}
.table thead th{background:rgba(219,234,254,0.45);} /* soft-blue */

.error{padding:12px;border-radius:14px;border:1px solid var(--border);background:var(--soft-red);color:#7f1d1d;font-weight:600;}


/* Social: reactions + share + comments */
.katy-toast{position:fixed;left:50%;bottom:18px;transform:translateX(-50%);background:rgba(17,24,39,0.92);color:#fff;padding:10px 14px;border-radius:999px;font-size:14px;z-index:9999;box-shadow:0 8px 18px rgba(0,0,0,0.2);}
.katy-toast.hidden{display:none;}

.interact{margin-top:12px;padding:12px;border:1px solid var(--border);border-radius:16px;background:rgba(241,245,249,0.55);}
.interact-row{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-bottom:10px;}
.interact-label{font-weight:800;color:var(--muted);font-size:13px;}
.my-react{margin-left:6px;font-size:18px;line-height:1;}
.my-react:empty{display:none;}
.react-buttons{display:flex;gap:6px;flex-wrap:wrap;}
.react-btn{border:1px solid var(--border);background:var(--card);padding:6px 10px;border-radius:999px;font-weight:800;cursor:pointer;display:flex;gap:6px;align-items:center;}
.react-btn .count{font-weight:900;color:var(--muted);font-size:12px;}
.react-btn.active{background:rgba(11,95,255,0.12);border-color:rgba(11,95,255,0.45);}

.comments-box{margin-top:6px;}
.comments-box.hidden{display:none;}
.comments-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;}
.comments-list{display:flex;flex-direction:column;gap:10px;margin-bottom:10px;}
.comment{border:1px solid var(--border);background:var(--card);border-radius:14px;padding:10px 12px;}
.comment .who{font-weight:900;font-size:13px;margin-bottom:4px;}
.comment .when{color:var(--muted);font-size:12px;margin-left:6px;font-weight:700;}
.comment .text{font-size:14px;white-space:pre-wrap;}

.comment-form textarea{width:100%;min-height:78px;border-radius:12px;border:1px solid var(--border);padding:10px;font-size:14px;}
.emoji-bar{display:flex;gap:6px;flex-wrap:wrap;margin:8px 0;}
.emoji-btn{border:1px solid var(--border);background:var(--card);padding:6px 8px;border-radius:12px;cursor:pointer;}

/* Community feed like state */
button.selected{background:rgba(239,68,68,0.12);border-color:rgba(239,68,68,0.4);}

/* ===============================
   Mobile UX polish / smoother layout
   =============================== */
html{scroll-behavior:smooth;}
body{-webkit-text-size-adjust:100%;}

:root{--safe-top:env(safe-area-inset-top, 0px);--safe-bottom:env(safe-area-inset-bottom, 0px);}
.katy-app-root{min-height:100dvh;}

/* Better touch targets */
button, .btn, .ghost, .nav a{touch-action:manipulation;}

/* Reduce heavy blur on low-end mobile browsers for smoother scrolling */
@media (max-width: 780px){
  .nav{backdrop-filter:none;-webkit-backdrop-filter:none;}
}

/* Ensure content is not hidden behind the fixed bottom nav */
@media (max-width: 780px){
  .container{margin:12px auto;padding:0 12px calc(92px + var(--safe-bottom));}
  .nav{padding-bottom:calc(8px + var(--safe-bottom));}
  .topbar{padding-top:calc(10px + var(--safe-top));}
}

/* Top bar wraps cleanly on small screens */
@media (max-width: 560px){
  .topbar{flex-wrap:wrap;gap:10px;}
  .top-actions{width:100%;justify-content:flex-end;flex-wrap:wrap;gap:8px;}
  .top-actions button{padding:10px 12px;font-size:14px;}
  .brand-text{font-size:16px;}
}

@media (max-width: 420px){
  .brand-text{display:none;}
  .top-actions button{padding:10px 10px;border-radius:16px;}
}

/* Nav items: consistent tap targets and readable labels */
@media (max-width: 780px){
  .nav a{min-width:64px;min-height:44px;}
  .nav a .nav-label{font-size:11px;}
  .nav a .nav-icon{width:22px;height:22px;}
}

/* Search bars: stack controls on mobile */
@media (max-width: 600px){
  .searchbar{flex-direction:column;align-items:stretch;}
  .searchbar input,.searchbar select,.searchbar button{width:100%;}
  .searchbar button{padding:12px 14px;}
}

/* Auction list/cards: more compact so users can see multiple items */
.auction-grid{grid-template-columns:repeat(auto-fill,minmax(300px,1fr));}
.auction-card .card-img{height:140px;object-fit:contain;background:#fff;}
.auction-card .card-title{font-size:18px;line-height:1.25;}
.row-actions{flex-wrap:wrap;gap:10px;}
.row-actions button{flex:1 1 120px;min-width:110px;}

@media (max-width: 420px){
  .auction-grid{grid-template-columns:1fr;}
  .auction-card .card-img{height:110px;}
  .pill{font-size:12px;padding:7px 10px;}
}

/* Interactions (reactions/share/comments): avoid overflow on small screens */
@media (max-width: 520px){
  .react-buttons{gap:8px;flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;padding-bottom:4px;}
  .react-btn{white-space:nowrap;}
  .interact-row{flex-direction:column;align-items:stretch;}
  .interact-actions{width:100%;justify-content:space-between;flex-wrap:wrap;}
  .interact-btn{justify-content:center;}
}

/* Game board: scale down on small devices */
@media (max-width: 520px){
  .game-cell{width:min(56px,18vw);height:min(56px,18vw);font-size:18px;}
}

/* Directory reviews */
.katy-review-pending{margin:0 0 6px 0;opacity:.75;}
.katy-review-body{white-space:normal;}

/* ===============================
   Mobile Theme (app-like)
   Enabled via Settings → UI Theme
   - Forced: body.katy-theme-mobile
   - Auto on mobile: body.katy-theme-auto.katy-is-mobile
   =============================== */
body.katy-theme-mobile,
body.katy-theme-auto.katy-is-mobile{
  --mobile-pad:12px;
  --mobile-radius:18px;
  --mobile-shadow:0 10px 28px rgba(0,0,0,.08);
  --safe-bottom: env(safe-area-inset-bottom);
  -webkit-tap-highlight-color:transparent;
}

/* More native-feeling typography on mobile */
body.katy-theme-mobile,
body.katy-theme-auto.katy-is-mobile{
  font-size:16px;
  line-height:1.35;
}

/* Reduce heavy blur effects to improve scroll smoothness */
body.katy-theme-mobile .topbar,
body.katy-theme-auto.katy-is-mobile .topbar,
body.katy-theme-mobile .nav,
body.katy-theme-auto.katy-is-mobile .nav{
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
}

/* Top bar: tighter and more "app" */
body.katy-theme-mobile .topbar,
body.katy-theme-auto.katy-is-mobile .topbar{
  padding:10px var(--mobile-pad);
  border-radius:0 0 var(--mobile-radius) var(--mobile-radius);
  box-shadow:0 6px 18px rgba(0,0,0,.06);
}

body.katy-theme-mobile .brand-logo,
body.katy-theme-auto.katy-is-mobile .brand-logo{width:32px;height:32px;}

body.katy-theme-mobile .top-actions button,
body.katy-theme-auto.katy-is-mobile .top-actions button{
  border-radius:999px;
  padding:10px 14px;
}

/* Container spacing */
body.katy-theme-mobile .container,
body.katy-theme-auto.katy-is-mobile .container{
  padding:0 var(--mobile-pad) calc(96px + var(--safe-bottom));
  margin:12px auto;
}

/* Cards: more elevated */
body.katy-theme-mobile .card,
body.katy-theme-auto.katy-is-mobile .card{
  border-radius:var(--mobile-radius);
  box-shadow:var(--mobile-shadow);
}

/* Bottom tab bar style (even when forced on desktop) */
body.katy-theme-mobile .nav,
body.katy-theme-auto.katy-is-mobile .nav{
  position:fixed;
  bottom:0;
  left:0;
  right:0;
  z-index:60;
  border-bottom:0;
  border-top:1px solid var(--border);
  background:rgba(255,255,255,.98);
  box-shadow:0 -8px 24px rgba(0,0,0,.10);
  padding:8px 8px calc(10px + var(--safe-bottom));
}

body.katy-theme-mobile .nav a,
body.katy-theme-auto.katy-is-mobile .nav a{
  padding:10px 8px;
  min-width:72px;
  min-height:48px;
  border-radius:16px;
}

body.katy-theme-mobile .nav a .nav-icon,
body.katy-theme-auto.katy-is-mobile .nav a .nav-icon{width:24px;height:24px;}

body.katy-theme-mobile .nav a .nav-label,
body.katy-theme-auto.katy-is-mobile .nav a .nav-label{font-size:11px;}

/* Make tap feedback feel native */
body.katy-theme-mobile button:active,
body.katy-theme-auto.katy-is-mobile button:active,
body.katy-theme-mobile .btn:active,
body.katy-theme-auto.katy-is-mobile .btn:active,
body.katy-theme-mobile .nav a:active,
body.katy-theme-auto.katy-is-mobile .nav a:active{
  transform:scale(.98);
}

@media (prefers-reduced-motion: reduce){
  body.katy-theme-mobile button:active,
  body.katy-theme-auto.katy-is-mobile button:active,
  body.katy-theme-mobile .btn:active,
  body.katy-theme-auto.katy-is-mobile .btn:active,
  body.katy-theme-mobile .nav a:active,
  body.katy-theme-auto.katy-is-mobile .nav a:active{transform:none;}
}

/* Mobile UI polish (v1.8.34)
   - Larger bottom nav targets
   - Larger form/action buttons on small screens
   - More obvious card spacing/elevation
*/
body.katy-theme-mobile .nav,
body.katy-theme-auto.katy-is-mobile .nav{
  gap:6px;
  padding:10px 10px calc(12px + var(--safe-bottom));
}

body.katy-theme-mobile .nav a,
body.katy-theme-auto.katy-is-mobile .nav a{
  min-width:64px;
  min-height:54px;
  padding:12px 8px;
}

body.katy-theme-mobile .nav a .nav-icon,
body.katy-theme-auto.katy-is-mobile .nav a .nav-icon{width:28px;height:28px;}

body.katy-theme-mobile .nav a .nav-label,
body.katy-theme-auto.katy-is-mobile .nav a .nav-label{font-size:12px;}

body.katy-theme-mobile .container,
body.katy-theme-auto.katy-is-mobile .container{
  padding-bottom:calc(112px + var(--safe-bottom));
}

/* Make list/search toolbars easier to tap on phones */
@media (max-width: 640px){
  body.katy-theme-mobile .notice .row,
  body.katy-theme-auto.katy-is-mobile .notice .row{
    align-items:stretch;
  }

  body.katy-theme-mobile .notice .row > input,
  body.katy-theme-auto.katy-is-mobile .notice .row > input,
  body.katy-theme-mobile .notice .row > select,
  body.katy-theme-auto.katy-is-mobile .notice .row > select{
    flex:1 1 100%;
    min-width:0;
  }

  body.katy-theme-mobile .notice .row > button,
  body.katy-theme-auto.katy-is-mobile .notice .row > button,
  body.katy-theme-mobile .notice .row > a,
  body.katy-theme-auto.katy-is-mobile .notice .row > a{
    flex:1 1 calc(50% - 6px);
    min-width:0;
  }
}

/* Cards: slightly more spacing and larger text on phones */
body.katy-theme-mobile .grid,
body.katy-theme-auto.katy-is-mobile .grid{gap:14px;}

body.katy-theme-mobile .card .p,
body.katy-theme-auto.katy-is-mobile .card .p{padding:14px 14px 16px;}

body.katy-theme-mobile .card h3,
body.katy-theme-auto.katy-is-mobile .card h3{font-size:18px;}

body.katy-theme-mobile .card p,
body.katy-theme-auto.katy-is-mobile .card p{font-size:14px;}

/* Prevent WordPress theme/plugin CSS collisions (many themes also use .card, .btn, etc.). */
.katy-app-root .card{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:16px;
  box-shadow:0 8px 20px rgba(0,0,0,.06);
  overflow:hidden;
}

/* Only target top-level media so icons inside the card body are not affected. */
.katy-app-root .card > img,
.katy-app-root .card > video{
  width:100% !important;
  height:160px !important;
  object-fit:cover !important;
  display:block;
}

/* On smaller screens, reduce media height to keep the feed compact. */
@media (max-width: 520px){
  .katy-app-root .card > img,
  .katy-app-root .card > video{
    height:140px !important;
  }
}

/* In-app Live (WebRTC) */
.live-preview{position:relative;width:100%;padding-top:56.25%;background:#000;border-radius:12px;overflow:hidden;}
.live-preview-video{position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;background:#000;}
.live-preview-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-top:10px;}
.live-perm-help{margin-top:8px;color:#555;}
.live-watch-wrap{display:block;}
.live-badge{display:inline-block;font-weight:700;font-size:12px;letter-spacing:.4px;padding:4px 8px;border-radius:999px;background:#d00;color:#fff;margin-bottom:8px;}
.live-video{width:100%;max-height:420px;background:#000;border-radius:12px;}
.live-watch-btn{width:100%;}

/* Community Clips (TikTok-style) */
.katy-clips-feed{
  max-width: 520px;
  margin: 0 auto;
  scroll-snap-type: y mandatory;
  height: calc(100vh - 330px);
  overflow-y: auto;
  overscroll-behavior-y: contain;
}

@supports (height: 100dvh){
  .katy-clips-feed{ height: calc(100dvh - 330px); }
}

.katy-clip{
  position: relative;
  width: 100%;
  margin: 0;
  border-radius: 0;
  overflow: hidden;
  background: #000;
  scroll-snap-align: start;
  height: 100%;
}

.katy-clip-video,
.katy-clip-iframe{
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  object-fit: cover;
}

.katy-clip-video-wrap{width:100%;height:100%;}

.katy-clip-stickers{position:absolute;inset:0;pointer-events:none;}
.katy-clip-sticker{position:absolute;transform:translate(-50%,-50%);filter:drop-shadow(0 2px 2px rgba(0,0,0,.55));user-select:none;white-space:pre;}

.katy-clip-overlay{
  position: absolute;
  left: 12px;
  right: 92px;
  bottom: 12px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.65);
}

.katy-clip-user{font-weight:700;margin-bottom:6px;}
.katy-clip-title{font-weight:600;margin-bottom:6px;}
.katy-clip-meta{font-size:12px;opacity:.9;}

.katy-clip-actions{
  position: absolute;
  right: 10px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.katy-clip-act{
  border: 0;
  border-radius: 999px;
  padding: 10px 10px;
  background: rgba(255,255,255,.88);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 52px;
}

.katy-clip-act.active{background:#fff;}
.katy-clip-ico{line-height:1;font-size:18px;}
.katy-clip-count{font-size:12px;margin-top:2px;line-height:1;}


/* Community media wrapper (video/image/embed) */
.comm-media{
  width:100%;
  border-radius:16px;
  overflow:hidden;
  background:#000;
  position:relative;
  margin-bottom:10px;
}

/* Video media gets a more immersive, TikTok-style ratio outside the main feed */
.comm-media--video{
  aspect-ratio:9/16;
  max-height:min(70vh, 720px);
}

/* Keep the main Feed lighter (less tall cards) */
#communityBody[data-comm-tab="feed"] .comm-media--video{
  aspect-ratio:16/9;
  max-height:420px;
}

/* Shared + My Videos should feel like a dedicated video surface */
#communityBody[data-comm-tab="shared"] .comm-media--video,
#communityBody[data-comm-tab="myvideos"] .comm-media--video{
  max-height:min(75vh, 800px);
}
.comm-media iframe,
.comm-media video{
  width:100%;
  height:100%;
  border:0;
  display:block;
  background:#000;
  object-fit:contain;
}

#communityBody[data-comm-tab="shared"] .comm-media--video video,
#communityBody[data-comm-tab="myvideos"] .comm-media--video video{
  object-fit:cover;
}

/* Community cards should not force a tiny fixed media height */
.katy-app-root .card.comm-card > video{
  height:auto !important;
  max-height:420px;
  object-fit:contain !important;
  background:#000;
}

/* My Videos: bulk select + delete */
.comm-card.mv-selectable{ position: relative; }
.mv-card-select{
  position:absolute;
  top:10px;
  right:10px;
  background: rgba(255,255,255,0.9);
  border:1px solid rgba(0,0,0,0.12);
  border-radius: 999px;
  padding:6px 8px;
  display:flex;
  align-items:center;
  z-index: 20;
}
.mv-card-select input{ width:18px; height:18px; }

.katy-btn.danger{ background:#dc2626; color:#fff; border-color:#dc2626; }
.katy-btn.danger:disabled{ opacity: .55; }

/* Community comments modal (used by Clips) */
body.katy-modal-open{
  overflow:hidden;
}
.katy-modal-backdrop{
  position:fixed;
  left:0; right:0; top:0; bottom:0;
  background:rgba(0,0,0,0.45);
  z-index:99999;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  padding:14px;
}
.katy-modal{
  width:100%;
  max-width:560px;
  background:#fff;
  border-radius:18px;
  overflow:hidden;
  box-shadow:0 12px 40px rgba(0,0,0,0.28);
  max-height:82vh;
  display:flex;
  flex-direction:column;
}
.katy-modal-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 14px;
  border-bottom:1px solid #e9eef6;
}
.katy-modal-title{
  font-weight:700;
  font-size:16px;
}
.katy-modal-close{
  border:0;
  background:transparent;
  font-size:22px;
  line-height:1;
  padding:4px 8px;
  cursor:pointer;
}
.katy-modal-body{
  padding:12px 14px;
  overflow:auto;
}


/* UI Option B tweaks */
.katy-ui-b .katy-clips-feed{
  max-width: 720px;
  scroll-snap-type: y mandatory;
}
.katy-ui-b .katy-clip-card{
  scroll-snap-align: start;
}
@media (max-width: 700px){
  .katy-ui-b .katy-clips-feed{ max-width: 100%; }
  .katy-ui-b .katy-clip-video{ border-radius: 0; }
  .katy-ui-b .katy-clip-card{ border-radius: 0; }
}

/* Community styling aligned with OneCommunity (BuddyPress) theme variables when present */
:root{
  --katy-primary: var(--dd-main-color, #1e73be);
  --katy-bg: var(--dd-background-1, #ffffff);
  --katy-bg-2: var(--dd-background-2, #f6f7fb);
  --katy-border: var(--dd-main-border-color, rgba(0,0,0,.12));
  --katy-text: var(--dd-text-color, #111827);
  --katy-muted: var(--dd-text-color-2, #6b7280);
}

.comm-shell{ background: transparent; }
.comm-header.notice{
  border: 1px solid var(--katy-border);
  background: var(--katy-bg);
}
.comm-tabs{
  border: 1px solid var(--katy-border);
  background: var(--katy-bg);
  border-radius: 12px;
  padding: 6px;
  gap: 6px;
  flex-wrap: wrap;
}
.comm-tabs .tab-btn{
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--katy-text);
  font-weight: 600;
  padding: 10px 12px;
}
.comm-tabs .tab-btn.active{
  background: var(--katy-bg-2);
  border-color: var(--katy-border);
}
.comm-body{ margin-top: 10px; }


/* ===== TV (YouTube channel) ===== */
.tv-player{position:relative;width:100%;padding-top:56.25%;background:#000;border-radius:12px;overflow:hidden;}
.tv-player iframe{position:absolute;top:0;left:0;width:100%;height:100%;border:0;}
.tv-thumbs{display:flex;gap:10px;overflow-x:auto;padding:12px 2px;margin-top:10px;}
.tv-thumb{flex:0 0 auto;width:160px;height:90px;border:1px solid rgba(255,255,255,.12);border-radius:10px;overflow:hidden;background:#111;cursor:pointer;padding:0;}
.tv-thumb img{width:100%;height:100%;object-fit:cover;display:block;}
.tv-thumb.active{outline:2px solid rgba(59,130,246,.9);outline-offset:2px;}
