:root {
    --bg-dark: #0f172a;
    --bg-panel: rgba(30, 41, 59, 0.7);
    --primary: #f43f5e;
    /* TikTok Pink-ish */
    --secondary: #3b82f6;
    /* Blue */
    --accent: #22d3ee;
    /* Cyan */
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

body {
    background-color: var(--bg-dark);
    background-image: radial-gradient(circle at 10% 20%, rgba(244, 63, 94, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.1) 0%, transparent 40%);
    color: var(--text-main);
    min-height: 100vh;
    padding: 0.8rem 1rem 3rem;
    /* Reduced padding for compact view */
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    /* Reduced margin */
    padding-bottom: 0.5rem;
    /* Reduced padding */
    border-bottom: 1px solid var(--border);
}

h1 {
    font-size: 1.8rem;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

/* Connect Panel */
.connect-panel {
    display: flex;
    gap: 1rem;
    align-items: center;
}

input[type="text"] {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    color: white;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    outline: none;
    font-size: 1rem;
    min-width: 250px;
}

input[type="text"]:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #e11d48);
    color: white;
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.4);
}

.btn-primary:hostname {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(244, 63, 94, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-module {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--secondary);
    color: var(--secondary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.btn-module:hover {
    background: var(--secondary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-auto-flow: dense;   /* fills gaps automatically */
    gap: 1rem;
    align-items: start;
}

/* Wide panels: occupy 2 grid columns */
.panel--wide {
    grid-column: span 2;
}

/* Full-width panels */
.panel--full {
    grid-column: 1 / -1;
}

/* Compact panels: explicitly 1 column */
.panel--compact {
    grid-column: span 1;
}

.panel {
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 12px;
    /* Slightly smaller radius */
    padding: 1rem;
    /* Reduced padding */
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    /* Reduced margin */
}

.panel-title {
    font-size: 1rem;
    /* Reduced font size */
    font-weight: 600;
    color: var(--accent);
}

/* Forms & Controls */
.form-group {
    margin-bottom: 0.6rem;
    /* Reduced margin */
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

select {
    width: 100%;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border);
    color: white;
    padding: 0.8rem;
    border-radius: 8px;
    outline: none;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--secondary);
}

/* Checkbox List */
.checkbox-list {
    display: grid;
    gap: 0.8rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background 0.2s;
}

.checkbox-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* Sound List */
.sound-list {
    display: grid;
    gap: 0.8rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.sound-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(15, 23, 42, 0.6);
    padding: 0.8rem;
    border-radius: 8px;
    border-left: 3px solid var(--secondary);
}

.sound-gift-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: #333;
}

.sound-info {
    flex: 1;
}

.sound-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.sound-trigger {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Status Bar */
.status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(5px);
    padding: 0.8rem 2rem;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--border);
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef4444;
}

.dot.connected {
    background: #22c55e;
    box-shadow: 0 0 10px #22c55e;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

/* Custom Dropdown for Images */
.custom-select-container {
    position: relative;
    width: 100%;
    font-size: 0.9rem;
}

.custom-select-trigger {
    background: #334155;
    color: white;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    user-select: none;
}

.custom-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 4px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.custom-select-options.open {
    display: block;
}

.custom-option {
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.custom-option:hover {
    background: #334155;
}

.custom-option.selected {
    background: #0f172a;
    border-left: 3px solid var(--secondary);
}

.gift-icon-sm {
    width: 20px;
    height: 20px;
    object-fit: cover;
    border-radius: 4px;
}

/* Modal Styles - ADDED FOR ADMIN PANEL */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    /* High z-index to be on top of everything */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    /* Darker background */
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #0f172a;
    margin: 10vh auto;
    /* 10% from top and centered */
    padding: 2rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    animation: modalFadeIn 0.3s ease-out;
}

.modal-content--compact {
    padding: 1.5rem;
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding-right: 1.5rem;
    /* space for close button */
}

.modal-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #ef4444;
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.08);
}

.modal-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.2;
}

.modal-subtitle {
    margin-top: 2px;
    font-size: 0.85rem;
    color: #94a3b8;
}

.modal-divider {
    height: 1px;
    background: rgba(148, 163, 184, 0.15);
    margin: 1rem 0 1.25rem;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-modal {
    color: #94a3b8;
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #ef4444;
}

/* Active Session Item */
.active-session-item {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    padding: 8px;
    margin-bottom: 5px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #f0fdf4;
}

.pulsing-dot {
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 8px #22c55e;
}

/* ============================================
   MOBILE RESPONSIVE STYLES
   ============================================ */

/* Tablet (max-width: 768px) → 2-col grid */
@media (max-width: 768px) {
    body {
        padding: 0.75rem;
    }

    header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.75rem;
    }

    .connect-panel {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    input[type="text"] {
        width: 100%;
        min-width: unset;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    /* Force 2-column grid on tablet */
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Wide panels take both columns */
    .panel--wide,
    .panel--full {
        grid-column: span 2;
    }

    /* Compact panel still takes 1 column */
    .panel--compact {
        grid-column: span 1;
    }

    .panel {
        padding: 0.85rem;
    }

    .leaderboard-list {
        max-height: 200px;
    }

    #logs {
        max-height: 250px;
        font-size: 0.85rem;
    }

    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 1.25rem;
    }

    .overlay-link-container {
        flex-direction: row;
    }
}

/* Phone (max-width: 520px) → 1-col grid */
@media (max-width: 520px) {
    body {
        padding: 0.5rem;
    }

    h1 {
        font-size: 1.25rem;
        text-align: center;
    }

    header {
        align-items: center;
    }

    /* All panels go to single column */
    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }

    .panel--wide,
    .panel--full,
    .panel--compact {
        grid-column: span 1;
    }

    .panel {
        padding: 0.75rem;
        border-radius: 10px;
    }

    /* Centered panel titles */
    .panel-header {
        justify-content: center;
    }

    .panel-title {
        font-size: 0.95rem;
        text-align: center;
    }

    /* Forms scale cleanly */
    input[type="text"],
    input[type="number"],
    input[type="password"],
    select,
    textarea {
        font-size: 15px;
        padding: 0.65rem 0.9rem;
    }

    .btn {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
    }

    /* Leaderboard tighter */
    .leaderboard-list {
        max-height: 180px;
    }

    .lb-name {
        max-width: 120px;
    }

    /* Logs */
    #logs {
        max-height: 180px;
        font-size: 0.8rem;
    }

    /* Overlay links → vertical stack on phone */
    .overlay-link-container {
        flex-direction: column;
        align-items: stretch;
    }

    .overlay-copy-btn {
        width: 100%;
        padding: 0.5rem;
        text-align: center;
    }

    .overlay-input {
        width: 100%;
    }

    /* Status bar compact */
    .status-bar {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        flex-wrap: wrap;
        gap: 0.3rem;
    }

    /* Modal */
    .modal-content {
        width: 98%;
        margin: 2% auto;
        padding: 1rem;
    }

    .modal-content h3 {
        font-size: 1rem;
    }

    .whitelist-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .whitelist-item button {
        width: 100%;
    }
}


/* Landscape orientation on phones */
@media (max-width: 768px) and (orientation: landscape) {
    #logs {
        max-height: 150px;
    }

    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
}
/* Leaderboard Styles */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 0.4rem;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.6);
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    gap: 0.8rem;
}

.leaderboard-rank {
    font-size: 1.2rem;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

.rank-1 .leaderboard-rank { color: #ffd700; text-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
.rank-2 .leaderboard-rank { color: #c0c0c0; text-shadow: 0 0 10px rgba(192, 192, 192, 0.5); }
.rank-3 .leaderboard-rank { color: #cd7f32; text-shadow: 0 0 10px rgba(205, 127, 50, 0.5); }

.leaderboard-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.leaderboard-name {
    font-weight: 600;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 120px;
}

.leaderboard-score {
    font-weight: bold;
    color: var(--primary);
    font-size: 0.9rem;
}

.overlay-link-container {
    margin-top: 0.8rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.overlay-input {
    flex: 1;
    min-width: 0;         /* prevents flex overflow */
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.overlay-copy-btn {
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0 0.8rem;
    cursor: pointer;
    font-size: 0.8rem;
}

/* ======== Leaderboard animated styles ======== */

/* Animations */
@keyframes lb-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  30%       { transform: translateY(-8px) scale(1.2); }
  60%       { transform: translateY(-3px) scale(1.05); }
}
@keyframes lb-sparkle {
  0%   { opacity: 0;   transform: scale(0.5) rotate(0deg); }
  50%  { opacity: 1;   transform: scale(1.3) rotate(15deg); }
  100% { opacity: 0;   transform: scale(0.5) rotate(30deg); }
}
@keyframes lb-glow-gold {
  0%,100% { box-shadow: 0 0 6px 2px rgba(255,215,0,0.4); }
  50%     { box-shadow: 0 0 20px 6px rgba(255,215,0,0.9); }
}
@keyframes lb-glow-silver {
  0%,100% { box-shadow: 0 0 6px 2px rgba(192,192,192,0.4); }
  50%     { box-shadow: 0 0 18px 5px rgba(192,192,192,0.8); }
}
@keyframes lb-glow-bronze {
  0%,100% { box-shadow: 0 0 6px 2px rgba(205,127,50,0.4); }
  50%     { box-shadow: 0 0 16px 5px rgba(205,127,50,0.8); }
}

/* Base leaderboard item */
.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  margin-bottom: 4px;
  background: rgba(30, 41, 59, 0.85);
  transition: background 0.3s;
}

/* Top-3 glow cards */
.lb-item-lb-gold   { background: rgba(40,30,5,0.9); animation: lb-glow-gold   2s ease-in-out infinite; border-left: 3px solid #ffd700; }
.lb-item-lb-silver { background: rgba(30,35,42,0.9); animation: lb-glow-silver 2.5s ease-in-out infinite; border-left: 3px solid #c0c0c0; }
.lb-item-lb-bronze { background: rgba(35,25,10,0.9); animation: lb-glow-bronze 3s ease-in-out infinite; border-left: 3px solid #cd7f32; }
.lb-item-normal    { background: rgba(25,32,45,0.7); }

/* Crown bounce */
.lb-crown {
  display: inline-block;
  font-size: 1.3rem;
  animation: lb-bounce 1.4s ease-in-out infinite;
}
.lb-crown-gold   { animation-duration: 1.2s; }
.lb-crown-silver { animation-duration: 1.5s; }
.lb-crown-bronze { animation-duration: 1.8s; }

/* Sparkles */
.lb-sparkles {
  font-size: 0.75rem;
  margin-left: 4px;
  animation: lb-sparkle 1.5s ease-in-out infinite;
}

/* Layout helpers */
.lb-rank  { min-width: 38px; text-align: center; font-weight: bold; font-size: 1.1rem; }
.lb-name  { flex: 1; font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.lb-score { font-weight: 800; font-size: 1rem; white-space: nowrap; }

/* OBS STYLE FREE RESIZING */
body.edit-mode .panel {
    resize: both !important;
    overflow: hidden !important;
    min-width: 250px;
    min-height: 120px;
    border: 2px dashed #6366f1 !important;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
    transition: none !important;
}

/* Ensure controls remain accessible during resize */
.panel-controls {
    display: none;
    align-items: center;
    gap: 8px;
}
body.edit-mode .panel-controls {
    display: flex;
}
body.edit-mode .drag-handle {
    cursor: grab;
    font-size: 1.2rem;
    color: #6366f1;
}
body.edit-mode .drag-handle:active {
    cursor: grabbing;
}


/* EDIT MODE GRID VISUALS */
body.edit-mode .dashboard-grid {
    background-size: 40px 40px;
    background-image:
      linear-gradient(to right, rgba(239, 68, 68, 0.1) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(239, 68, 68, 0.1) 1px, transparent 1px);
    border: 2px solid #ef4444; /* Marco rojo */
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
    padding: 20px;
    border-radius: 12px;
    min-height: 400px;
    transition: all 0.3s;
}


/* NEW GIFT STICKER */
.new-gift-sticker {
    background: #ef4444;
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    text-transform: uppercase;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
    animation: pulse-red 2s infinite;
    flex-shrink: 0;
}

@keyframes pulse-red {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* ============================================
   CUSTOM PUZZLE LAYOUT (EDIT MODE)
   ============================================ */
body.edit-mode {
    background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
}

body.edit-mode .panel {
    border: 2px dashed #ff073a !important;
    box-shadow: 0 0 15px rgba(255, 7, 58, 0.5) !important;
    resize: both;
    overflow: hidden; /* Needed for CSS resize to work natively */
    position: relative;
    transition: none !important; /* Disable transitions while resizing */
}

/* Arrow buttons for moving panels left/right */
.btn-move {
    display: none; /* hidden by default */
    padding: 2px 6px;
    font-size: 0.8rem;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    margin-right: 4px;
    transition: all 0.2s;
}

body.edit-mode .btn-move {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

body.edit-mode .btn-move:hover {
    color: #fff;
    background: #475569;
}

/* ============================================
   MOBILE IMPROVEMENTS — RESPONSIVE UPGRADE
   ============================================ */

/* ── Header compacto en móvil ── */
@media (max-width: 768px) {
    header {
        padding: 10px 12px;
        gap: 10px;
    }

    /* Logo más pequeño */
    header h1 {
        font-size: 1.1rem;
        white-space: nowrap;
    }

    /* Botones de módulos en grid 2x2 */
    header > div:first-child > div:nth-child(2) {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 5px;
        margin-left: 0 !important;
        padding-left: 0 !important;
        border-left: none !important;
        width: 100%;
    }

    .btn-module {
        font-size: 0.7rem !important;
        padding: 6px 8px !important;
        text-align: center;
        justify-content: center;
    }

    /* Input de conexión ancho completo */
    .connect-panel {
        width: 100%;
    }

    /* Touch targets mínimo 44px */
    .btn, button, .btn-module {
        min-height: 40px;
    }
}

/* ── Grids internos de contadores (5 cols → 1 col en móvil) ── */
@media (max-width: 680px) {
    /* Counter config grid: 2.5fr 1fr 1.5fr 2fr 1.5fr → columnas apiladas */
    [style*="grid-template-columns:2.5fr 1fr 1.5fr 2fr 1.5fr"],
    [style*="grid-template-columns: 2.5fr 1fr 1.5fr 2fr 1.5fr"] {
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
    }

    /* giftsGrid en panel de regalos */
    #giftsGrid {
        grid-template-columns: 1fr !important;
    }

    /* Botones de acción en contadores → fila en vez de columna */
    [style*="display:flex;gap:6px"] {
        flex-wrap: wrap;
    }
}

/* ── Phone pequeño (< 480px) ── */
@media (max-width: 480px) {
    /* Grids internos de contadores → 1 columna */
    [style*="grid-template-columns:2.5fr"],
    [style*="grid-template-columns: 2.5fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Status bar muy compacta */
    .status-bar {
        padding: 6px 10px;
        font-size: 0.75rem;
        gap: 6px;
    }

    /* Ocultar labels largos en status bar en teléfono muy pequeño */
    .status-bar .status-item span:not(.dot):not(#viewerCount):not(#statusText) {
        display: none;
    }

    /* Battle power toast más pequeño en móvil */
    .battle-power-toast {
        bottom: 70px !important;  /* Sobre la status bar */
        right: 10px !important;
        min-width: 200px !important;
        max-width: 260px !important;
        font-size: 0.82rem !important;
    }

    /* Modales ocupan pantalla completa */
    .modal-content {
        width: 100% !important;
        margin: 0 !important;
        border-radius: 0 !important;
        min-height: 100vh;
        padding: 1rem !important;
    }

    /* Overlay links apilados */
    .overlay-link-container {
        flex-direction: column;
        gap: 6px;
    }
    .overlay-copy-btn {
        width: 100%;
        padding: 8px;
    }
}

/* ── Mejoras táctiles globales (evitar zoom en iOS al hacer tap en inputs) ── */
@media (max-width: 768px) {
    input[type="text"],
    input[type="number"],
    input[type="password"],
    input[type="email"],
    select,
    textarea {
        font-size: 16px !important;  /* iOS no hace zoom si font-size >= 16px */
    }

    /* Scroll suave en toda la página */
    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }

    /* Prevenir selección accidental en botones táctiles */
    button, .btn, .btn-module {
        -webkit-tap-highlight-color: transparent;
        user-select: none;
    }
}
