/* ==========================================================================
   GLOBAL VARIABLES & MASTER resets
   ========================================================================== */
:root {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --card-bg: rgba(255, 255, 255, 0.06);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --accent-cyan: #06b6d4;
    --accent-pink: #ec4899;
    --accent-purple: #a855f7;
    --accent-green: #10b981;
    --accent-orange: #f97316;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    margin: 0; padding: 0;
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    display: flex; flex-direction: column;
}

header { text-align: center; padding: 2.5rem 2rem 1rem 2rem; }
header h1 {
    font-size: 3rem; margin: 0 0 0.5rem 0; font-weight: 800;
    background: linear-gradient(to right, var(--accent-cyan), var(--accent-pink));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* ==========================================================================
   CONSTRAINED CONTROL NAVIGATION DOCK
   ========================================================================== */
.top-controls {
    display: flex; justify-content: center; align-items: center; gap: 12px;
    max-width: 650px; width: 100%; margin: 0 auto 2.5rem auto; padding: 0 1rem;
    box-sizing: border-box;
}

.search-input {
    flex: 1; min-width: 0; padding: 0.8rem 1.2rem; font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.05); border: 2px solid var(--card-border);
    border-radius: 12px; color: white; outline: none; transition: all 0.3s ease;
}
.search-input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

.bored-btn {
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-pink));
    color: white; border: none; padding: 0.8rem 1.2rem; font-size: 0.95rem;
    font-weight: 700; border-radius: 12px; cursor: pointer; white-space: nowrap;
    transition: transform 0.2s, box-shadow 0.2s; text-decoration: none;
    display: flex; align-items: center; gap: 6px;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.2);
}
.bored-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(249, 115, 22, 0.4); }
.library-btn { background: rgba(255, 255, 255, 0.08); border: 2px solid var(--card-border); }
.library-btn:hover { background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.4); }

/* ==========================================================================
   SYMMETRICAL 3-COLUMN CONTENT CORE
   ========================================================================== */
.main-container {
    display: flex; flex: 1; max-width: 1600px; width: 100%;
    margin: 0 auto 3rem auto; padding: 0 1rem; gap: 2rem; box-sizing: border-box;
}

main { flex: 3; min-width: 0; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem; }

/* ==========================================================================
   INTERACTIVE CARDS & HOVER HINTS
   ========================================================================== */
.tool-card, .game-card {
    background: var(--card-bg); border: 2px solid var(--card-border);
    backdrop-filter: blur(12px); border-radius: 16px; padding: 1.75rem;
    text-decoration: none; color: inherit; position: relative; cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s, opacity 0.2s;
}
.tool-card:active, .game-card:active { cursor: grabbing; }
.tool-card.dragging, .game-card.dragging { opacity: 0.4; border: 2px dashed var(--accent-purple); }
.tool-card:hover, .game-card:hover { transform: translateY(-4px); box-shadow: 0 15px 30px rgba(0,0,0,0.4); border-color: rgba(255,255,255,0.3); }

.tool-card h3, .game-card h3 { margin: 0 0 0.6rem 0; font-size: 1.3rem; }
.tool-card p, .game-card p { color: var(--text-muted); font-size: 0.9rem; margin: 0; line-height: 1.5; }

/* Tooltip Popup Triggers */
.info-trigger {
    position: absolute; top: 12px; right: 12px; background: rgba(255, 255, 255, 0.1);
    width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-size: 0.8rem; cursor: pointer; transition: background 0.2s; z-index: 5;
}
.info-trigger:hover { background: var(--accent-purple); }
.info-trigger .tooltip-text {
    visibility: hidden; width: 190px; background-color: #1e1b4b; color: #fff;
    text-align: center; border-radius: 8px; padding: 8px; position: absolute;
    bottom: 125%; right: 0; opacity: 0; transition: opacity 0.25s;
    font-size: 0.75rem; border: 1px solid var(--accent-purple); pointer-events: none;
}
.info-trigger:hover .tooltip-text { visibility: visible; opacity: 1; }

/* Subpage Help Systems */
.help-container {
    background: linear-gradient(90deg, rgba(168, 85, 247, 0.15), rgba(236, 72, 153, 0.15));
    border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 1rem 1.5rem;
    margin-bottom: 2rem; display: flex; align-items: center; justify-content: space-between;
}
.close-help-btn { background: transparent; border: none; color: white; cursor: pointer; font-size: 1.2rem; opacity: 0.5; }
.close-help-btn:hover { opacity: 1; }
.tool-wrapper { background: rgba(255,255,255,0.03); border: 1px solid var(--card-border); padding: 2.5rem; border-radius: 24px; }

/* ==========================================================================
   PRODUCTION GOOGLE ADSENSE ALIGNMENT SLOTS
   ========================================================================== */
.live-ad-sidebar {
    flex: 1;
    min-width: 250px;
    max-width: 300px;
    height: 600px;
    background: transparent;
}

.live-ad-bottom {
    max-width: 728px;
    width: 100%;
    height: 90px;
    margin: 0 auto 3rem auto;
    background: transparent;
}

footer { text-align: center; padding: 2rem; border-top: 1px solid var(--card-border); color: var(--text-muted); background: rgba(0,0,0,0.2); margin-top: auto; }

/* ==========================================================================
   RESPONSIVE DESIGN BREAKPOINTS
   ========================================================================== */
@media (max-width: 1100px) {
    .main-container { flex-direction: column; align-items: center; }
    .live-ad-sidebar { max-width: 728px; width: 100%; height: 150px; }
    main { order: -1; width: 100%; }
}
@media (max-width: 600px) {
    .top-controls { flex-direction: column; align-items: stretch; }
    .search-input, .bored-btn { width: 100%; text-align: center; justify-content: center; }
    header h1 { font-size: 2.25rem; }
}