/* Ronda — estilos. Concepto: fondo #101014, superficies #181820, acento coral #ff6a4d. */
:root{
  --bg:#101014;
  --surface:#181820;
  --surface-2:#1f1f28;
  --border:#26262e;
  --accent:#ff6a4d;
  --accent-dark:#e0532f;
  --accent-soft:rgba(255,106,77,.14);
  --text:#f4f1ea;
  --muted:#a7a3b0;
  --green:#5fc97e;
  --radius:16px;
  --nav-h:64px;
}
*{box-sizing:border-box;margin:0;padding:0}
html{-webkit-text-size-adjust:100%}
body{
  background:var(--bg);
  color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  line-height:1.5;
  min-height:100vh;
}
a{color:inherit;text-decoration:none}
img{display:block;max-width:100%}
button{font:inherit;color:inherit;background:none;border:none;cursor:pointer}
input,textarea,select{font:inherit;color:var(--text)}

/* ---------- Layout ---------- */
#layout{display:flex;min-height:100vh}
#sidebar{
  width:248px;flex-shrink:0;
  border-right:1px solid var(--border);
  padding:20px 14px;
  position:sticky;top:0;height:100vh;
  display:flex;flex-direction:column;gap:24px;
  background:var(--bg);
}
#side-nav{display:flex;flex-direction:column;gap:4px}
#side-nav a{
  display:flex;align-items:center;gap:14px;
  padding:12px 14px;border-radius:12px;
  font-weight:600;color:var(--muted);
}
#side-nav a svg{width:24px;height:24px;flex-shrink:0}
#side-nav a:hover{background:var(--surface);color:var(--text)}
#side-nav a.active{background:var(--accent-soft);color:var(--accent)}
.side-foot{margin-top:auto;padding:0 14px}
.side-foot a{color:var(--muted);font-size:14px}
.side-foot a:hover{color:var(--text)}

#main-col{flex:1;min-width:0;display:flex;flex-direction:column}
#topbar{
  position:sticky;top:0;z-index:40;
  display:flex;align-items:center;gap:12px;
  padding:12px 20px;
  background:rgba(16,16,20,.92);
  backdrop-filter:blur(8px);
  border-bottom:1px solid var(--border);
}
#top-search{
  flex:1;max-width:520px;display:flex;align-items:center;gap:8px;
  background:var(--surface);border:1px solid var(--border);
  border-radius:999px;padding:9px 16px;
}
#top-search svg{width:18px;height:18px;color:var(--muted);flex-shrink:0}
#top-search input{flex:1;background:none;border:none;outline:none;color:var(--text)}
#top-search input::placeholder{color:var(--muted)}
.top-actions{margin-left:auto;display:flex;align-items:center;gap:8px}
.icon-btn{
  position:relative;display:flex;align-items:center;justify-content:center;
  width:44px;height:44px;border-radius:50%;color:var(--text);
}
.icon-btn:hover{background:var(--surface)}
.icon-btn svg{width:24px;height:24px}
.avatar-link img{width:32px;height:32px;border-radius:50%;object-fit:cover}
.badge{
  position:absolute;top:4px;right:4px;min-width:20px;height:20px;
  padding:0 6px;border-radius:999px;
  background:var(--accent);color:#101014;
  font-size:12px;font-weight:700;
  display:flex;align-items:center;justify-content:center;
}
#bottom-perfil .badge{top:2px;right:calc(50% - 22px)}

#app{width:100%;max-width:720px;margin:0 auto;padding:20px 16px 48px}

/* Logo: dos círculos coral + nombre */
.logo{display:flex;align-items:center;gap:10px;font-size:22px;font-weight:800;letter-spacing:-.02em}
.logo-mark{position:relative;display:inline-block;width:34px;height:22px;flex-shrink:0}
.logo-mark i{position:absolute;top:0;width:22px;height:22px;border-radius:50%;background:var(--accent)}
.logo-mark i:first-child{left:0}
.logo-mark i:last-child{left:12px;opacity:.62}

/* ---------- Nav inferior (móvil) ---------- */
#bottomnav{display:none}
.mobile-only{display:none}

/* ---------- Componentes ---------- */
.card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:16px;
  margin-bottom:14px;
}
.hero{padding:8px 4px 18px}
.hero h1{font-size:clamp(26px,5vw,36px);font-weight:800;letter-spacing:-.02em;line-height:1.15}
.hero p{color:var(--muted);margin-top:6px;font-size:16px}

.tabs{display:flex;gap:4px;border-bottom:1px solid var(--border);margin-bottom:16px}
.tabs a{
  padding:12px 16px;font-weight:600;color:var(--muted);
  border-bottom:2px solid transparent;margin-bottom:-1px;
}
.tabs a.active{color:var(--text);border-bottom-color:var(--accent)}

.chip{
  display:inline-flex;align-items:center;gap:6px;
  font-size:12.5px;font-weight:600;
  padding:4px 12px;border-radius:999px;
  background:var(--surface-2);color:var(--muted);
  border:1px solid var(--border);
  white-space:nowrap;
}
.chip.cat{color:var(--text)}
.chip.st-abierta{background:rgba(95,201,126,.14);color:var(--green);border-color:rgba(95,201,126,.3)}
.chip.st-cerrada{color:var(--muted)}
.chip.st-resultado{background:var(--accent-soft);color:var(--accent);border-color:rgba(255,106,77,.35)}
.chip.hl{background:var(--accent);color:#101014;border-color:var(--accent)}

.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  min-height:44px;padding:10px 22px;border-radius:999px;
  background:var(--accent);color:#101014;
  font-weight:700;font-size:15px;
}
.btn:hover{background:var(--accent-dark)}
.btn:disabled{opacity:.55;cursor:wait}
.btn-small{min-height:38px;padding:8px 18px;font-size:14px}
.btn-ghost{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  min-height:44px;padding:10px 20px;border-radius:999px;
  border:1px solid var(--border);color:var(--text);font-weight:600;
  background:var(--surface);
}
.btn-ghost:hover{border-color:var(--muted)}
.btn-ghost:disabled{opacity:.55;cursor:wait}
.btn-danger-ghost{
  display:inline-flex;align-items:center;justify-content:center;
  min-height:44px;padding:10px 20px;border-radius:999px;
  border:1px solid rgba(255,110,110,.4);color:#ff8a8a;font-weight:600;background:transparent;
}
.btn-danger-ghost:hover{background:rgba(255,110,110,.1)}
.link-btn{color:var(--accent);font-weight:600;font-size:14px;padding:6px 4px}
.link-btn:hover{text-decoration:underline}
.link-btn.muted{color:var(--muted)}

.avatar{border-radius:50%;object-fit:cover;flex-shrink:0;background:var(--surface-2)}
.avatar-fallback{
  display:inline-flex;align-items:center;justify-content:center;
  background:var(--accent-soft);color:var(--accent);
  font-weight:800;border-radius:50%;flex-shrink:0;
}

/* Tarjeta de ronda */
.round-card .rc-top{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:10px}
.rc-author{display:flex;align-items:center;gap:10px;min-width:0}
.rc-author-txt{display:flex;flex-direction:column;min-width:0}
.rc-author-txt b{font-size:14.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rc-author-txt small{color:var(--muted);font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rc-top .chips{display:flex;gap:6px;flex-shrink:0}
.rc-title{font-size:19px;font-weight:700;line-height:1.3;margin-bottom:6px}
.rc-title a:hover{color:var(--accent)}
.rc-desc{color:var(--muted);font-size:15px;margin-bottom:10px;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.rc-img{margin:0 -16px 10px;border-radius:0;overflow:hidden}
.rc-img img{width:100%;max-height:340px;object-fit:cover}
.rc-foot{display:flex;align-items:center;justify-content:space-between;gap:10px}
.rc-count{color:var(--muted);font-size:14px;font-weight:600}
.rc-count:hover{color:var(--text)}

/* Formularios */
.form-card h2{font-size:22px;margin-bottom:4px}
.form-card .form-sub{color:var(--muted);font-size:14.5px;margin-bottom:18px}
.field{margin-bottom:16px}
.field label{display:block;font-weight:600;font-size:14.5px;margin-bottom:6px}
.field .hint{font-size:13px;color:var(--muted);margin-top:4px}
.text-input,textarea.text-input,select.text-input{
  width:100%;background:var(--bg);
  border:1px solid var(--border);border-radius:12px;
  padding:12px 14px;outline:none;resize:vertical;
}
.text-input:focus{border-color:var(--accent)}
.text-input::placeholder{color:var(--muted)}
input[type="file"].text-input{padding:10px 14px}
.form-error{
  background:rgba(255,110,110,.1);border:1px solid rgba(255,110,110,.4);
  color:#ff9a9a;border-radius:12px;padding:12px 14px;margin-bottom:16px;font-size:14.5px;
}
.form-ok{
  background:rgba(95,201,126,.1);border:1px solid rgba(95,201,126,.4);
  color:var(--green);border-radius:12px;padding:12px 14px;margin-bottom:16px;font-size:14.5px;
}
.char-count{font-size:12.5px;color:var(--muted);text-align:right;margin-top:4px}
.check-row{display:flex;align-items:flex-start;gap:10px;padding:10px 0;border-bottom:1px solid var(--border)}
.check-row:last-child{border-bottom:none}
.check-row input[type="checkbox"]{width:20px;height:20px;margin-top:2px;accent-color:var(--accent);flex-shrink:0}
.check-row .cr-text{font-size:14px}
.check-row .cr-text small{display:block;color:var(--muted)}

/* Estados */
.empty{
  text-align:center;padding:48px 24px;
  background:var(--surface);border:1px dashed var(--border);border-radius:var(--radius);
  margin-bottom:14px;
}
.empty .empty-art{
  width:64px;height:64px;margin:0 auto 16px;border-radius:50%;
  background:var(--accent-soft);display:flex;align-items:center;justify-content:center;
}
.empty .empty-art svg{width:30px;height:30px;color:var(--accent)}
.empty h3{font-size:18px;margin-bottom:6px}
.empty p{color:var(--muted);font-size:14.5px;margin-bottom:18px;max-width:380px;margin-left:auto;margin-right:auto}
.state-error{
  text-align:center;padding:40px 24px;
  background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);margin-bottom:14px;
}
.state-error p{color:var(--muted);margin-bottom:16px}
.skel{margin-bottom:14px}
.skel .sk{
  border-radius:8px;margin-bottom:10px;
  background:linear-gradient(90deg,var(--surface) 25%,var(--surface-2) 50%,var(--surface) 75%);
  background-size:200% 100%;animation:shimmer 1.4s infinite;
}
@keyframes shimmer{to{background-position:-200% 0}}

.pager{display:flex;align-items:center;justify-content:center;gap:12px;padding:8px 0 24px;color:var(--muted);font-size:14.5px}

/* Detalle de ronda */
.round-detail-head .rc-title{font-size:24px}
.round-meta{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:12px 0}
.round-desc-full{font-size:16px;white-space:pre-wrap;margin:8px 0 4px}
.round-author-row{display:flex;align-items:center;gap:12px;margin:14px 0;padding:12px;background:var(--bg);border-radius:12px}
.round-author-row .grow{flex:1;min-width:0}
.round-author-row .grow b{display:block;font-size:15px}
.round-author-row .grow small{color:var(--muted)}
.round-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.round-img-full{margin:12px -16px 0}
.round-img-full img{width:100%;max-height:420px;object-fit:cover}

.section-title{font-size:18px;font-weight:700;margin:24px 0 12px;display:flex;align-items:center;gap:8px}
.section-title .count{font-size:13px;color:var(--muted);font-weight:600}

.contrib{border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);padding:16px;margin-bottom:12px}
.contrib.highlighted{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}
.contrib.flash{animation:flash 2s}
@keyframes flash{0%,40%{box-shadow:0 0 0 2px var(--accent)}100%{box-shadow:none}}
.contrib-head{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.contrib-head .grow{flex:1;min-width:0}
.contrib-head .grow b{font-size:14.5px;display:block}
.contrib-head .grow small{color:var(--muted);font-size:13px}
.contrib-actions{display:flex;gap:2px;flex-wrap:wrap}
.contrib-text{font-size:15.5px;white-space:pre-wrap;margin-bottom:10px}
.contrib-img{margin:0 -16px 10px}
.contrib-img img{width:100%;max-height:320px;object-fit:cover}
.contrib-foot{display:flex;align-items:center;gap:8px;border-top:1px solid var(--border);padding-top:10px;margin-top:6px}
.react-btn{
  display:inline-flex;align-items:center;gap:6px;
  padding:8px 14px;border-radius:999px;border:1px solid var(--border);
  font-size:14px;font-weight:600;color:var(--muted);min-height:40px;
}
.react-btn svg{width:18px;height:18px}
.react-btn.on{border-color:var(--accent);color:var(--accent);background:var(--accent-soft)}
.react-btn:disabled{opacity:.5}

.comments{margin-top:12px;border-top:1px solid var(--border);padding-top:12px}
.comment{display:flex;gap:10px;margin-bottom:12px}
.comment .c-body{flex:1;min-width:0;background:var(--bg);border-radius:12px;padding:10px 12px}
.comment .c-body b{font-size:13.5px}
.comment .c-body small{color:var(--muted);font-size:12.5px;margin-left:6px}
.comment .c-body p{font-size:14.5px;margin-top:2px;white-space:pre-wrap}
.comment .c-actions{display:flex;gap:8px;margin-top:4px}
.comment-form{display:flex;gap:8px;margin-top:8px}
.comment-form input{flex:1;background:var(--bg);border:1px solid var(--border);border-radius:999px;padding:10px 16px;outline:none;min-width:0}
.comment-form input:focus{border-color:var(--accent)}

.result-card{border:1px solid var(--accent);background:linear-gradient(180deg,rgba(255,106,77,.08),var(--surface));border-radius:var(--radius);padding:18px;margin:18px 0}
.result-card h3{display:flex;align-items:center;gap:8px;font-size:18px;margin-bottom:10px;color:var(--accent)}
.result-card .result-text{white-space:pre-wrap;font-size:15.5px;margin-bottom:12px}
.credits{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.credit{display:inline-flex;align-items:center;gap:6px;background:var(--bg);border:1px solid var(--border);border-radius:999px;padding:6px 12px 6px 6px;font-size:13.5px;font-weight:600}
.closed-note{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:14px 16px;color:var(--muted);font-size:14.5px;margin:16px 0;text-align:center}

/* Perfil */
.profile-head{text-align:center;padding:8px 0 4px}
.profile-head .avatar{margin:0 auto 12px}
.profile-head h2{font-size:22px}
.profile-head .uname{color:var(--muted);font-size:15px;margin-bottom:8px}
.profile-head .bio{font-size:15px;max-width:480px;margin:0 auto 14px;white-space:pre-wrap}
.profile-stats{display:flex;justify-content:center;gap:28px;margin-bottom:16px}
.profile-stats .stat{text-align:center}
.profile-stats .stat b{display:block;font-size:19px}
.profile-stats .stat span{color:var(--muted);font-size:13px}
.profile-actions{display:flex;justify-content:center;gap:10px;flex-wrap:wrap;margin-bottom:8px}

/* Explorar */
.search-row{display:flex;gap:8px;margin-bottom:14px}
.search-row input{flex:1;background:var(--surface);border:1px solid var(--border);border-radius:999px;padding:12px 18px;outline:none}
.search-row input:focus{border-color:var(--accent)}
.cat-chips{display:flex;gap:8px;overflow-x:auto;padding-bottom:8px;margin-bottom:8px;-webkit-overflow-scrolling:touch}
.cat-chips .chip{cursor:pointer;padding:8px 16px;font-size:14px;min-height:40px}
.cat-chips .chip.on{background:var(--accent);color:#101014;border-color:var(--accent)}
.user-row{display:flex;align-items:center;gap:12px;padding:12px 16px}
.user-row .grow{flex:1;min-width:0}
.user-row .grow b{display:block}
.user-row .grow small{color:var(--muted)}

/* Ajustes */
.settings-section{margin-bottom:8px}
.settings-section h3{font-size:17px;margin-bottom:12px}
.avatar-edit{display:flex;align-items:center;gap:16px;margin-bottom:16px}
.blocked-row{display:flex;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid var(--border)}
.blocked-row:last-child{border-bottom:none}
.blocked-row .grow{flex:1;min-width:0}

/* Admin */
.report{border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);padding:16px;margin-bottom:12px}
.report-head{display:flex;justify-content:space-between;gap:10px;margin-bottom:8px;flex-wrap:wrap}
.report .reason{background:var(--bg);border-radius:10px;padding:10px 12px;font-size:14.5px;margin:8px 0;white-space:pre-wrap}
.report-meta{font-size:13px;color:var(--muted);margin-bottom:8px}
.report-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:10px}
.log-table{width:100%;border-collapse:collapse;font-size:14px}
.log-table th{text-align:left;color:var(--muted);font-weight:600;padding:10px 8px;border-bottom:1px solid var(--border)}
.log-table td{padding:10px 8px;border-bottom:1px solid var(--border);vertical-align:top}
.log-wrap{overflow-x:auto}

/* ---------- Panel de notificaciones ---------- */
.notif-panel{
  position:fixed;z-index:100;
  width:370px;max-width:calc(100vw - 24px);max-height:70vh;
  background:var(--surface-2);border:1px solid var(--border);
  border-radius:var(--radius);box-shadow:0 18px 50px rgba(0,0,0,.55);
  display:flex;flex-direction:column;overflow:hidden;
}
/* El atributo hidden debe imponerse sobre cualquier display de componentes. */
[hidden]{display:none!important}
.notif-panel[hidden]{display:none}
.notif-head{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid var(--border)}
.notif-head h3{font-size:16px}
.notif-list{overflow-y:auto;padding:8px}
.notif-item{
  display:flex;gap:12px;width:100%;text-align:left;
  padding:12px;border-radius:12px;align-items:flex-start;
}
.notif-item:hover{background:var(--surface)}
.notif-item .n-body{flex:1;min-width:0;font-size:14px}
.notif-item .n-body p{margin-bottom:2px}
.notif-item .n-snippet{color:var(--muted);font-size:13px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.notif-item time{color:var(--muted);font-size:12.5px}
.notif-item .dot{width:9px;height:9px;border-radius:50%;background:var(--accent);flex-shrink:0;margin-top:7px}
.notif-item.read{opacity:.65}
.notif-empty{padding:32px 16px;text-align:center;color:var(--muted);font-size:14.5px}
.notif-panel.sheet{
  left:0;right:0;bottom:0;top:auto !important;
  width:100%;max-width:100%;max-height:82vh;
  border-radius:20px 20px 0 0;
}
.sheet-grab{width:44px;height:5px;border-radius:999px;background:var(--border);margin:10px auto 0}

/* ---------- Modal ---------- */
.modal-backdrop{
  position:fixed;inset:0;z-index:120;
  background:rgba(0,0,0,.65);
  display:flex;align-items:center;justify-content:center;
  padding:16px;
}
.modal{
  background:var(--surface-2);border:1px solid var(--border);
  border-radius:var(--radius);padding:22px;
  width:100%;max-width:480px;max-height:88vh;overflow-y:auto;
}
.modal h3{font-size:19px;margin-bottom:6px}
.modal .m-sub{color:var(--muted);font-size:14.5px;margin-bottom:16px}
.modal-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:18px;flex-wrap:wrap}

/* ---------- Toast ---------- */
#toast-root{position:fixed;bottom:84px;left:50%;transform:translateX(-50%);z-index:200;display:flex;flex-direction:column;gap:8px;align-items:center;pointer-events:none}
.toast{
  background:var(--surface-2);border:1px solid var(--border);
  border-radius:999px;padding:12px 22px;font-size:14.5px;font-weight:600;
  box-shadow:0 8px 24px rgba(0,0,0,.5);
  animation:toastIn .25s ease-out;
}
.toast.ok{border-color:var(--green)}
.toast.err{border-color:#ff6e6e}
@keyframes toastIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

.auth-wrap{max-width:440px;margin:24px auto}
.auth-wrap .logo{justify-content:center;margin-bottom:24px;font-size:28px}
.auth-alt{text-align:center;margin-top:16px;color:var(--muted);font-size:14.5px}
.auth-alt a{color:var(--accent);font-weight:600}

/* ---------- Responsive ---------- */
@media (max-width:900px){
  #sidebar{display:none}
  .desktop-only{display:none !important}
  .mobile-only{display:flex}
  #topbar{padding:10px 14px}
  #app{padding:16px 12px 110px}
  #bottomnav{
    display:grid;grid-template-columns:1fr 1fr 1fr 1fr;
    position:fixed;left:0;right:0;bottom:0;z-index:50;
    background:rgba(16,16,20,.96);backdrop-filter:blur(10px);
    border-top:1px solid var(--border);
    padding:6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  #bottomnav a{
    display:flex;flex-direction:column;align-items:center;gap:3px;
    color:var(--muted);font-size:11px;font-weight:600;padding:6px 2px;
    position:relative;
  }
  #bottomnav a svg{width:24px;height:24px}
  #bottomnav a.active{color:var(--accent)}
  #bottomnav a.fab{
    width:56px;height:56px;border-radius:50%;
    background:var(--accent);color:#101014;
    justify-content:center;margin:-22px auto 0;
    box-shadow:0 6px 18px rgba(255,106,77,.4);
  }
  #bottomnav a.fab svg{width:28px;height:28px}
  #bottomnav a.fab.active{color:#101014}
  .modal{padding:18px}
}
@media (min-width:901px){
  .notif-panel.sheet{border-radius:var(--radius)}
}
