:root {
    --primary: #4361ee;
    --secondary: #3f37c9;
    --accent: #4cc9f0;
    --bg: #f8f9fa;
    --text: #2b2d42;
    --card: #fff;
    --border: #e9ecef;
    --success: #2a9d8f;
    --danger: #e63946;
    --font: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif
}

/* Override font specifically for Arabic pages */
html[lang="ar"] {
    --font: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Override font for Hindi pages (Devanagari) — the Mukta webfont is
   injected into /hi/ pages by build-i18n.js (LANGUAGE_FONTS) */
html[lang="hi"] {
    --font: 'Mukta', 'Nirmala UI', 'Kohinoor Devanagari', 'Segoe UI', Tahoma, sans-serif;
}

/* OPTIONAL: enable ONLY together with LANGUAGE_FONTS in build-i18n.js
html[lang="id"],
html[lang="fil"] {
    --font: 'Plus Jakarta Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
*/

/* Devanagari matras (marks above/below letters) need more vertical room
   than Latin — prevents clipped glyphs in the tight line-heights below */
html[lang="hi"] .hero-title,
html[lang="hi"] .blog-article h1,
html[lang="hi"] .blog-hero h1,
html[lang="hi"] .tools-menu-item span {
    line-height: 1.45;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-tap-highlight-color: transparent
}

/* ===== HEADER ===== */
header {
    background: var(--card);
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap
}

.page-title {
    display: flex;
    align-items: center;
    gap: .5rem
}

.logo {
    width: 48px;
    height: 48px;
    padding: .25rem;
    flex-shrink: 0
}

h1 {
    font-size: 1.4rem;
    color: var(--primary);
    font-weight: 800;
    white-space: nowrap
}

.lang-select {
    padding: .5rem .75rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    font-size: .9rem;
    cursor: pointer;
    width: 15%;
    font-family: var(--font)
}

.native-ad-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center
}

.ad-label {
    font-size: .7rem;
    color: #999;
    margin-bottom: .4rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    align-self: flex-start
}

.ad-container {
    width: 100%;
    min-height: 70px;
    max-width: 1140px;
    background: #f9fafb;
    border: 1px dashed var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden
}

/* ===== MAIN ===== */
main {
    flex: 1;
    padding: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%
}

/* ===== APP CONTAINER ===== */
.app-container {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    transition: grid-template-columns 0.3s ease
}

/* ===== HIDE/SHOW CONTROLS LOGIC ===== */
.app-container {
    transition: grid-template-columns 0.3s ease;
}

/* When all closed, shrink sidebar to 60px to show only icons */
.app-container.no-controls {
    grid-template-columns: 1fr 60px !important;
}

.app-container.no-controls .control-body {
    display: none !important;
}

.app-container.no-controls .controls-section {
    padding: 1rem 0.5rem;
}

.app-container.no-controls .control-header {
    justify-content: center;
    padding: 0.6rem 0;
}

.app-container.no-controls .control-header .toggle-icon {
    display: none;
}

/* ===== WHEEL SECTION ===== */
.wheel-section {
    background: var(--card);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .05);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    max-height: 78vh;
    display: flex;
    flex-direction: column;
    min-height: 0
}

.canvas-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .5rem;
    flex-shrink: 0;
    gap: .5rem
}

.canvas-top-bar .btn-secondary-share {
    flex: 1;
    min-height: 42px
}

.canvas-viewport {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    overflow: hidden
}

canvas {
    cursor: pointer;
    transition: transform .1s;
    touch-action: manipulation
}

canvas:active {
    transform: scale(.98)
}

.center-circle-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--primary);
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 1px 3px rgba(255, 255, 255, .8);
    transition: opacity .2s
}

/* ===== CONTROLS SECTION (ACCORDION) ===== */
.controls-section {
    background: var(--card);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .05);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto
}

.control-block {
    display: flex;
    flex-direction: column
}

.control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .6rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: var(--primary);
    transition: all .2s;
    font-size: 1rem;
    font-family: var(--font)
}

.control-header:hover {
    background: rgba(67, 97, 238, .1)
}

.control-header.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary)
}

.control-header .toggle-icon {
    transition: transform .3s;
    font-size: .8rem
}

.control-header.active .toggle-icon {
    transform: rotate(180deg)
}

.control-body {
    display: none;
    flex-direction: column;
    gap: .85rem;
    padding: 1rem 0.25rem 0.25rem;
    animation: fadeIn .3s ease
}

.control-body.active {
    display: flex
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: .4rem
}

label {
    font-weight: 600;
    font-size: .85rem;
    color: #6c757d
}

textarea {
    width: 100%;
    height: 130px;
    padding: .65rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: var(--font);
    resize: vertical;
    font-size: .9rem
}

select {
    width: 100%;
    padding: .55rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: .9rem;
    font-family: var(--font)
}

#sound-type-select {
    width: 60%
}

.btn-group {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: .5rem
}

button {
    padding: .55rem .85rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all .2s;
    font-size: .85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    font-family: var(--font);
    min-height: 42px
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    grid-column: span 2;
    padding: .9rem;
    font-size: 1.05rem
}

.btn-secondary {
    background: #e9ecef;
    color: var(--text)
}

.btn-secondary-share {
    grid-column: span 2;
    background: #25D366;
    color: #fff
}

.btn-danger {
    background: #ffe5e5;
    color: var(--danger)
}

button:hover {
    opacity: .9;
    transform: translateY(-1px)
}

button:disabled {
    opacity: .5;
    cursor: not-allowed
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .45rem 0;
    border-top: 1px solid var(--border);
    gap: .5rem;
    flex-wrap: wrap
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer
}

.tab-badge {
    background: var(--primary);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.5;
    display: inline-block
}

/* ===== RESULTS ===== */
.results-panel {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    height: 100%
}

.results-summary {
    display: flex;
    gap: .6rem;
    flex-wrap: wrap
}

.results-stat {
    flex: 1;
    min-width: 70px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .5rem;
    text-align: center
}

.results-stat-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2
}

.results-stat-label {
    font-size: .65rem;
    color: #8b8fa3;
    text-transform: uppercase;
    letter-spacing: .03em;
    font-weight: 600
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem
}

.results-controls {
    display: flex;
    gap: .5rem;
    align-items: center
}

.sort-select {
    padding: .4rem;
    font-size: .82rem;
    width: auto;
    border: 1px solid var(--border);
    border-radius: 4px
}

.results-list {
    list-style: none;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fdfdfd;
    flex: 1;
    min-height: 120px;
    max-height: 480px
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .55rem .75rem;
    border-bottom: 1px solid #f0f0f0;
    font-size: .88rem;
    transition: background .15s
}

.result-item:hover {
    background: #f7f8fc
}

.result-item:last-child {
    border-bottom: none
}

.result-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%
}

.result-count {
    background: var(--primary);
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: .78rem;
    font-weight: bold;
    min-width: 24px;
    text-align: center
}

.empty-state {
    padding: 2rem 1.25rem;
    text-align: center;
    color: #bbb;
    font-size: .88rem;
    font-style: italic;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem
}

.empty-state i {
    font-size: 1.8rem;
    color: #ddd
}

.results-actions {
    display: flex;
    gap: .5rem
}

.btn-icon {
    padding: .4rem;
    font-size: .85rem;
    border-radius: 4px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    min-height: 38px
}

.btn-icon:hover {
    background: #e2e6ea
}

/* ===== TOAST ===== */
.toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2000;
    pointer-events: none;
    width: max-content;
    max-width: 90vw
}

.toast {
    background: rgba(40, 40, 40, .95);
    color: #fff;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: .9rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
    opacity: 0;
    transform: translateY(20px);
    animation: toastIn .3s forwards, toastOut .3s forwards 2.5s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap
}

.toast i {
    color: var(--success)
}

@keyframes toastIn {
    to {
        opacity: 1;
        transform: translateY(0)
    }
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateY(-20px)
    }
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, .6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
    padding: 1rem
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto
}

.modal {
    background: #fff;
    padding: 1.75rem;
    border-radius: 14px;
    text-align: center;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
    transform: scale(.8);
    transition: transform .3s cubic-bezier(.175, .885, .32, 1.275)
}

.modal-overlay.active .modal {
    transform: scale(1)
}

.winner-text {
    font-size: 1.75rem;
    font-weight: bold;
    color: var(--primary);
    margin: .75rem 0;
    word-wrap: break-word
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px
}

/* ===== MISC ===== */
.button-wheel-examples {
    background: var(--primary);
    color: #e9ecef
}

.tooltip {
    position: relative;
    display: inline-block
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 140px;
    background: var(--accent);
    color: var(--card);
    text-align: center;
    padding: 5px;
    border-radius: 6px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity .3s;
    font-size: .8rem
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1
}

.float-btn {
    position: fixed;
    width: 52px;
    height: 52px;
    bottom: 24px;
    right: 24px;
    background: #007bff;
    color: #FFF;
    border-radius: 50%;
    text-align: center;
    box-shadow: 2px 2px 3px #999;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 28px;
    transition: background .2s, transform .2s
}

.float-btn:hover {
    background: #0056b3;
    transform: scale(1.08)
}

/* ===== JUMP LINKS ===== */
.jump-links {
    max-width: 1200px;
    margin: 0 auto 1.25rem;
    width: 100%;
    padding: 0 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem
}

.jump-links a {
    display: inline-block;
    padding: .3rem .7rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: .88rem;
    color: var(--primary);
    text-decoration: none;
    transition: all .2s
}

.jump-links a:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary)
}

/* ===== INFO & FAQ ===== */
.info-section {
    background: var(--card);
    border-radius: 12px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .05)
}

.info-section h2 {
    color: var(--primary);
    margin-bottom: .85rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: .45rem;
    font-size: 1.3rem
}

.info-section ul {
    margin-left: 1.25rem;
    margin-top: .75rem
}

.info-section li {
    margin-bottom: .45rem;
    font-size: .92rem
}

.faq-section {
    background: var(--card);
    border-radius: 12px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .05)
}

.faq-section h2 {
    color: var(--primary);
    margin-bottom: 1.25rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: .45rem;
    font-size: 1.3rem
}

.faq-item {
    border-bottom: 1px solid var(--border);
    padding: .85rem 0
}

.faq-item:last-child {
    border-bottom: none
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
    gap: .75rem;
    user-select: none
}

.faq-question:hover {
    color: var(--primary)
}

.faq-icon {
    flex-shrink: 0;
    font-size: .85rem;
    color: var(--primary);
    transition: transform .3s
}

.faq-item.open .faq-icon {
    transform: rotate(180deg)
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease, padding .35s ease;
    color: #555;
    line-height: 1.65;
    font-size: .92rem
}

.faq-item.open .faq-answer {
    max-height: 500px;
    padding-top: .65rem
}

/* ===== FOOTER ===== */
.site-footer {
    background-color: #fff;
    color: var(--text);
    padding: 3rem 0 0;
    margin-top: 2.5rem;
    border-top: 1px solid var(--border)
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2.5rem
}

.footer-col {
    display: flex;
    flex-direction: column
}

.footer-brand {
    max-width: 300px
}

.footer-brand .footer-logo {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: .85rem;
    display: flex;
    align-items: center;
    gap: .5rem
}

.footer-brand p {
    font-size: .88rem;
    color: #6c757d;
    line-height: 1.6;
    margin-bottom: 1.25rem
}

.footer-col h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1rem;
    position: relative
}

.footer-col:not(.footer-brand) h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 28px;
    height: 3px;
    background-color: var(--primary);
    border-radius: 2px
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0
}

.footer-links li {
    margin-bottom: .65rem
}

.footer-links a {
    text-decoration: none;
    color: #6c757d;
    font-size: .9rem;
    transition: all .2s ease;
    display: inline-block
}

.footer-links a:hover {
    color: var(--primary);
    transform: translateX(5px)
}

.footer-bottom {
    background-color: #f8f9fa;
    padding: 1.25rem 0;
    text-align: center;
    font-size: .82rem;
    color: #6c757d;
    border-top: 1px solid var(--border)
}

.social-icons {
    display: flex;
    gap: .85rem
}

.social-link {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: #f1f3f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    text-decoration: none;
    transition: all .2s ease
}

.social-link:hover {
    background-color: var(--primary);
    color: #fff;
    transform: translateY(-3px)
}

/* ===== FULLSCREEN BUTTON ===== */
.btn-fullscreen {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
    font-size: 1.1rem;
    transition: all .2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
    padding: 0;
    flex-shrink: 0
}

.btn-fullscreen:hover {
    background: var(--primary);
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(67, 97, 238, .3)
}

/* ===== EXIT FULLSCREEN FLOATING BUTTON ===== */
.fs-exit-btn {
    position: fixed;
    top: 1.25rem;
    left: 1.25rem;
    display: none;
    align-items: center;
    gap: .45rem;
    padding: .5rem 1rem;
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: 25px;
    cursor: pointer;
    z-index: 1100;
    color: var(--text);
    font-size: .85rem;
    font-weight: 600;
    transition: all .25s;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
    font-family: var(--font)
}

.fs-exit-btn:hover {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
    transform: scale(1.03)
}

.fs-exit-btn i {
    font-size: .9rem
}

/* ===== FULLSCREEN TOGGLE FOR CONTROLS (mobile) ===== */
.fs-controls-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1100;
    font-size: 1.3rem;
    box-shadow: 0 4px 20px rgba(67, 97, 238, .4);
    transition: all .25s
}

.fs-controls-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(67, 97, 238, .5)
}

/* ===== FULLSCREEN MODE OVERRIDES ===== */
body.is-fullscreen header,
body.is-fullscreen .jump-links,
body.is-fullscreen .native-ad-section,
body.is-fullscreen .info-section,
body.is-fullscreen .faq-section,
body.is-fullscreen .site-footer,
body.is-fullscreen .float-btn {
    display: none !important
}

body.is-fullscreen {
    background: var(--bg);
    overflow: hidden
}

body.is-fullscreen main {
    padding: 0;
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column
}

body.is-fullscreen .app-container {
    flex: 1;
    margin-bottom: 0;
    gap: 1.25rem;
    min-height: 0
}

@media(min-width:901px) {
    body.is-fullscreen .app-container {
        grid-template-columns: 1fr 350px;
        padding: 1.25rem
    }

    body.is-fullscreen .wheel-section {
        border-radius: 16px;
        padding: 1.25rem;
        min-height: 0
    }

    body.is-fullscreen .canvas-wrapper {
        min-height: 0;
        flex: 1;
        max-height: calc(100vh - 5rem);
        max-height: calc(100dvh - 5rem)
    }

    body.is-fullscreen .controls-section {
        border-radius: 14px;
        max-height: calc(100vh - 3rem);
        max-height: calc(100dvh - 3rem);
        overflow-y: auto
    }
}

@media(max-width:900px) {
    body.is-fullscreen .app-container {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
        padding: .75rem;
        gap: .5rem
    }

    body.is-fullscreen .wheel-section {
        border-radius: 14px;
        padding: .75rem;
        min-height: 0;
        flex: 1;
        overflow: hidden
    }

    body.is-fullscreen .canvas-wrapper {
        min-height: 0;
        max-height: calc(100vh - 8rem);
        max-height: calc(100dvh - 8rem);
        flex: 1
    }

    body.is-fullscreen .controls-section {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 55vh;
        border-radius: 18px 18px 0 0;
        transform: translateY(100%);
        transition: transform .35s cubic-bezier(.4, 0, .2, 1);
        z-index: 1050;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, .15);
        overflow-y: auto
    }

    body.is-fullscreen .controls-section.fs-panel-open {
        transform: translateY(0)
    }

    body.is-fullscreen .fs-controls-fab {
        display: flex
    }

    body.is-fullscreen .fs-exit-btn {
        top: .75rem;
        left: .75rem
    }
}

body.is-fullscreen .fs-exit-btn {
    display: flex
}

.fs-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, .35);
    z-index: 1040;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s
}

.fs-backdrop.visible {
    opacity: 1;
    pointer-events: auto
}

body.is-fullscreen .wheel-section {
    animation: fsFadeIn .4s ease
}

@keyframes fsFadeIn {
    from {
        opacity: 0;
        transform: scale(.96)
    }

    to {
        opacity: 1;
        transform: scale(1)
    }
}

/* ============================== */
/* ===== RESPONSIVE: TABLET ===== */
/* ============================== */
@media(max-width:900px) {
    .app-container {
        grid-template-columns: 1fr
    }

    .canvas-wrapper {
        max-height: 62vh
    }

    h1 {
        font-size: 1.25rem
    }

    .logo {
        width: 42px;
        height: 42px
    }
}

/* ============================== */
/* ===== RESPONSIVE: MOBILE ===== */
/* ============================== */
@media(max-width:600px) {
    header {
        padding: .65rem .85rem;
        gap: .6rem
    }

    h1 {
        font-size: 1.1rem
    }

    .logo {
        width: 36px;
        height: 36px
    }

    .lang-select {
        min-width: 110px;
        padding: .45rem .6rem;
        font-size: .82rem
    }

    .native-ad-section {
        width: 100%;
        order: 3
    }

    .ad-container {
        min-height: 60px
    }

    main {
        padding: 1rem .75rem
    }

    .jump-links {
        padding: 0 .75rem;
        gap: .3rem;
        margin-bottom: 1rem
    }

    .jump-links a {
        font-size: .78rem;
        padding: .25rem .55rem
    }

    .app-container {
        gap: 1rem;
        margin-bottom: 2rem
    }

    .wheel-section {
        padding: .85rem;
        border-radius: 10px
    }

    .canvas-wrapper {
        max-height: 52vh;
        aspect-ratio: auto
    }

    .canvas-top-bar {
        gap: .35rem
    }

    .canvas-top-bar .btn-secondary-share {
        font-size: .78rem;
        padding: .45rem .6rem;
        min-height: 38px
    }

    .btn-fullscreen {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        font-size: .95rem
    }

    .center-circle-label {
        font-size: .9rem !important
    }

    .controls-section {
        border-radius: 10px;
        padding: .75rem
    }

    .control-header {
        padding: .5rem .75rem;
        font-size: .9rem
    }

    .control-body {
        padding: .75rem .1rem 0.1rem
    }

    textarea {
        height: 90px;
        font-size: .85rem;
        padding: .55rem
    }

    select {
        font-size: .85rem;
        padding: .5rem
    }

    button {
        font-size: .82rem;
        min-height: 40px;
        padding: .5rem .7rem
    }

    .btn-primary {
        padding: .75rem;
        font-size: .95rem
    }

    #sound-type-select {
        width: 55%
    }

    .setting-row {
        padding: .35rem 0;
        font-size: .82rem
    }

    label {
        font-size: .8rem
    }

    .results-stat {
        min-width: 60px;
        padding: .4rem
    }

    .results-stat-value {
        font-size: 1.05rem
    }

    .results-stat-label {
        font-size: .6rem
    }

    .results-list {
        max-height: 250px;
        min-height: 80px
    }

    .result-item {
        padding: .45rem .6rem;
        font-size: .82rem
    }

    .info-section,
    .faq-section {
        padding: 1.15rem;
        border-radius: 10px;
        margin-bottom: 1.15rem
    }

    .info-section h2,
    .faq-section h2 {
        font-size: 1.1rem
    }

    .info-section li,
    .faq-answer {
        font-size: .85rem
    }

    .faq-question {
        font-size: .9rem
    }

    .modal {
        padding: 1.25rem;
        border-radius: 12px
    }

    .winner-text {
        font-size: 1.35rem
    }

    .modal-actions button {
        font-size: .85rem
    }

    .float-btn {
        width: 46px;
        height: 46px;
        font-size: 24px;
        bottom: 18px;
        right: 18px
    }

    .btn-group {
        grid-template-columns: 1fr 1fr
    }
}

/* ===== VERY SMALL PHONES (≤380px) ===== */
@media(max-width:380px) {
    header {
        padding: .5rem .65rem
    }

    h1 {
        font-size: 1rem
    }

    .logo {
        width: 30px;
        height: 30px
    }

    .lang-select {
        min-width: 100px;
        font-size: .78rem
    }

    main {
        padding: .75rem .6rem
    }

    .wheel-section {
        padding: .65rem
    }

    .canvas-wrapper {
        max-height: 46vh
    }

    .control-body {
        padding: .65rem .1rem 0.1rem;
        gap: .6rem
    }

    textarea {
        height: 75px
    }

    .info-section,
    .faq-section {
        padding: 1rem
    }

    .info-section h2,
    .faq-section h2 {
        font-size: 1rem
    }
}

/* ===== FOOTER RESPONSIVE ===== */
@media(max-width:900px) {
    .footer-container {
        grid-template-columns: 1fr 1fr
    }

    .footer-brand {
        grid-column: span 2;
        max-width: 100%
    }
}

@media(max-width:600px) {
    .footer-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 1rem
    }

    .footer-brand {
        grid-column: span 1
    }

    .footer-links a:hover {
        transform: translateX(3px)
    }

    .site-footer {
        padding-top: 2rem
    }
}

/* ===== RTL ===== */
[dir="rtl"] .footer-links a:hover {
    transform: translateX(-5px)
}

[dir="rtl"] .footer-col:not(.footer-brand) h4::after {
    left: auto;
    right: 0
}

/* ===== LANDSCAPE MOBILE ===== */
@media(max-width:900px) and (orientation:landscape) {
    .canvas-wrapper {
        max-height: 80vh
    }

    .app-container {
        gap: .75rem
    }
}

@media(max-width:600px) and (orientation:landscape) {
    .canvas-wrapper {
        max-height: 72vh
    }
}

/* ===== PRINT ===== */
@media print {

    header,
    .controls-section,
    .float-btn,
    .native-ad-section,
    .fs-exit-btn,
    .fs-controls-fab,
    .fs-backdrop,
    .toast-container,
    .modal-overlay,
    .jump-links {
        display: none !important
    }

    .wheel-section {
        box-shadow: none;
        border: 1px solid #ccc
    }

    .info-section,
    .faq-section {
        box-shadow: none;
        break-inside: avoid
    }
}

/* ===== PAGE HERO / CONTEXT SECTION ===== */
.page-hero {
    max-width: 1200px;
    margin: 0 auto 1.5rem;
    padding: 1.5rem 1.5rem 0;
    text-align: center
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem
}

.hero-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
    margin: 0
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--primary);
    max-width: 700px;
    margin: 0 auto 0.5rem;
    line-height: 1.5
}

.hero-badges {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 0.5rem
}

.badge {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--secondary);
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem
}

.badge i {
    color: var(--primary)
}

@media(max-width:600px) {
    .page-hero {
        padding: 1rem 1rem 0
    }

    .hero-title {
        font-size: 1.6rem
    }

    .hero-desc {
        font-size: 1rem
    }

    .badge {
        font-size: 0.75rem;
        padding: 0.3rem 0.7rem
    }
}

/* ===== CHECKBOX LIST INPUTS ===== */
.option-input-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.option-input-row input {
    flex: 1;
    padding: 0.55rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: var(--font);
    font-size: 0.9rem;
}

.option-input-row button {
    min-width: 42px;
    padding: 0.55rem 0;
}

.checklist-container {
    width: 100%;
    min-height: 140px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
    background: var(--card);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.checklist-item:hover {
    background: var(--bg);
}

.checklist-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.checklist-item label {
    flex: 1;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text);
    user-select: none;
    word-break: break-word;
}

/* ===== PREDEFINED WHEELS ACCORDION ===== */
.accordion-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.accordion-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg);
}

.accordion-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--card);
    border: none;
    cursor: pointer;
    font-size: 1.05rem;
    text-align: left;
    transition: background 0.2s;
}

.accordion-header:hover {
    background: rgba(67, 97, 238, 0.05);
}

.accordion-header a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}

.accordion-header a:hover {
    text-decoration: underline;
}

.accordion-icon {
    transition: transform 0.3s ease;
    color: var(--primary);
    font-size: 0.9rem;
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    padding: 0 1.25rem;
}

.accordion-item.active .accordion-content {
    max-height: 1000px;
    /* Large enough to fit content */
    padding: 0.5rem 1.25rem 1.25rem;
}

.accordion-content p {
    margin-bottom: 1rem;
    color: #555;
    font-size: 0.95rem;
}

.accordion-content h3 {
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.accordion-content ul {
    margin-left: 1.25rem;
}

.accordion-content li {
    margin-bottom: 0.5rem;
    font-size: 0.92rem;
    color: #555;
}

/* ===== ALL TOOLS GRID ===== */
.all-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.tool-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-color: transparent;
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-card-icon {
    width: 50px;
    height: 50px;
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.tool-card:hover .tool-card-icon {
    background: var(--primary);
    color: #fff;
}

.tool-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.tool-card-desc {
    font-size: 0.9rem;
    color: #6c757d;
    line-height: 1.5;
    margin-bottom: 1.25rem;
    flex-grow: 1;
}

.tool-card-btn {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: gap 0.2s ease;
}

.tool-card:hover .tool-card-btn {
    gap: 0.8rem;
}

/* ===== HEADER TOOLS MEGA MENU ===== */
.header-left-group {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.tools-dropdown {
    position: relative;
}

.tools-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
    font-family: var(--font);
    height: 100%;
    /* Match height of other elements */
}

.tools-dropdown-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.tools-dropdown-arrow {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

/* Rotate arrow when active */
.tools-dropdown.active .tools-dropdown-arrow {
    transform: rotate(180deg);
}

.tools-dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    width: 680px;
    /* Width for 4 columns */
    max-width: 90vw;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* 4 Columns */
    gap: 0.75rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

/* Show menu when active */
.tools-dropdown.active .tools-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tools-menu-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    transition: background 0.2s;
}

.tools-menu-item:hover {
    background: var(--bg);
}

.tools-menu-item i {
    color: var(--primary);
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.tools-menu-item span {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
}

/* Responsive: 2 columns on mobile */
@media (max-width: 768px) {
    .tools-dropdown-menu {
        grid-template-columns: repeat(2, 1fr);
        width: 320px;
        padding: 1rem;
    }

    .header-left-group {
        gap: 1rem;
    }
}

/* ===== COUNTRY WHEEL UI ===== */
.region-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.region-checkboxes label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--text);
}

.region-checkboxes input {
    accent-color: var(--primary);
    width: 14px;
    height: 14px;
}

/* Flag image inside the checklist */
.checklist-flag-img {
    width: 22px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
    vertical-align: middle;
    margin-right: 8px;
}

/* ===== FLAG QUIZ MODAL ===== */
.quiz-choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin: 1rem 0;
}

.quiz-choice-btn {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 42px;
    color: var(--text);
    font-family: var(--font);
}

.quiz-choice-btn:hover:not(:disabled) {
    border-color: var(--primary);
    background: rgba(67, 97, 238, 0.05);
}

.quiz-choice-btn.correct {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.quiz-choice-btn.wrong {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

.quiz-flag-img {
    width: 30px;
    height: 20px;
    object-fit: cover;
    border-radius: 2px;
}

.quiz-flag-img-large {
    width: 80px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    margin: 0 auto 1rem;
    display: block;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.quiz-feedback {
    margin-top: 1rem;
    font-size: 1rem;
    text-align: center;
}

/* Style for disabled dropdown options */
select option:disabled {
    color: #aaa;
    background-color: #f9f9f9;
}

/* ===== TEAM PICKER ===== */
.team-picker-container {
    grid-template-columns: 340px 1fr !important;
}

.tp-player-input-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.tp-player-input-row input {
    flex: 1;
    padding: 0.55rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: var(--font);
    font-size: 0.9rem;
}

.tp-player-input-row button {
    min-width: 42px;
    padding: 0.55rem 0;
}

.tp-teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.tp-team-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .05);
    transition: all 0.2s;
}

.tp-team-card.drag-over {
    border-color: var(--primary);
    border-style: dashed;
    background: rgba(67, 97, 238, 0.05);
}

.tp-team-name-input {
    width: 100%;
    border: none;
    border-bottom: 2px solid var(--border);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
    padding: 0.25rem 0;
    background: transparent;
    font-family: var(--font);
}

.tp-team-name-input:focus {
    outline: none;
    border-bottom-color: var(--primary);
}

.tp-team-players {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 50px;
}

.tp-player-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: grab;
    transition: transform 0.1s, box-shadow 0.1s;
}

.tp-player-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tp-player-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.tp-player-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.tp-player-label {
    font-size: 0.75rem;
    background: var(--primary);
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
}

.tp-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    color: #bbb;
    padding: 4rem 1rem;
    font-style: italic;
}

.tp-empty-state i {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
    color: #ddd;
}

.tp-player-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.tp-player-list-item .tp-pl-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.tp-player-list-item .tp-pl-label {
    font-size: 0.7rem;
    background: #eee;
    color: #333;
    padding: 2px 6px;
    border-radius: 4px;
}

.tp-btn-remove-player {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 0 5px;
}

@media (max-width: 900px) {
    .team-picker-container {
        grid-template-columns: 1fr !important;
    }
}

/* ===== TEAM PICKER ADDITIONS ===== */
/* ===== TEAM PICKER ACTIONS BAR ===== */
.tp-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.tp-hint-banner {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(67, 97, 238, 0.2);
    flex: 1;
}

.tp-hint-banner i {
    font-size: 1rem;
}

.tp-action-buttons {
    display: flex;
    gap: 0.5rem;
}

.tp-action-buttons button {
    margin: 0;
}

.tp-player-edit-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    width: 100%;
}

.tp-player-edit-row input {
    flex: 1;
    padding: 0.3rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.85rem;
    background: var(--card);
}

.tp-player-edit-row select {
    flex: 0.5;
    padding: 0.3rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.85rem;
    background: var(--card);
}

/* Team Card Colors */
.tp-team-card {
    border-top: 5px solid var(--primary);
}

.tp-team-card.color-0 {
    border-top-color: #4361ee;
}

.tp-team-card.color-1 {
    border-top-color: #e63946;
}

.tp-team-card.color-2 {
    border-top-color: #2a9d8f;
}

.tp-team-card.color-3 {
    border-top-color: #f4a261;
}

.tp-team-card.color-4 {
    border-top-color: #9d4edd;
}

.tp-team-card.color-5 {
    border-top-color: #00b4d8;
}

.tp-team-card.color-6 {
    border-top-color: #ff8531;
}

.tp-team-card.color-7 {
    border-top-color: #bc5090;
}

.tp-team-name-input {
    cursor: text;
    border-bottom: 2px dashed var(--border);
}

.tp-team-name-input:focus {
    border-bottom-style: solid;
}

/* ===== TEAM PICKER HEADER FIX ===== */
.tp-control-header {
    justify-content: flex-start !important;
    gap: 0.5rem;
}

.tp-control-header i {
    color: inherit !important;
    /* Inherits white when active, and primary blue when inactive */
    font-size: 1rem;
    display: inline-block !important;
}

/* ===== DATE PICKER UI ===== */
.dp-input-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.dp-input-row input {
    flex: 1;
    padding: 0.55rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: var(--font);
    font-size: 0.9rem;
}

.dp-day-filter {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.dp-day-filter label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--text);
    justify-content: center;
}

.dp-day-filter input {
    accent-color: var(--primary);
    width: 14px;
    height: 14px;
}

/* ===== IMAGE PICKER UI ===== */
.ip-upload-area {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ip-upload-area input[type="file"] {
    display: none;
}

.ip-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--primary);
    color: #fff;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.2s;
    font-family: var(--font);
    font-size: 0.9rem;
}

.ip-upload-btn:hover {
    opacity: 0.9;
}

/* ===== TRUTH OR DARE UI ===== */
.tod-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.tod-radio-group label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--text);
    transition: all 0.2s;
}

.tod-radio-group input {
    accent-color: var(--primary);
    width: 14px;
    height: 14px;
}

.tod-radio-group label:has(input:checked) {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ===== BLOG NAV LINK ===== */
.nav-blog-link {
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    height: 100%;
    /* Match height of other header elements */
}

.nav-blog-link:hover {
    background: var(--primary);
    color: #fff;
}

/* ===== HEADER MEGA MENU CATEGORIZED ===== */
.tools-dropdown-menu {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* 4 Columns by default */
    gap: 1.5rem;
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
    width: 680px;
    max-width: 90vw;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
}

/* Show menu when active */
.tools-dropdown.active .tools-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tools-menu-col {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.tools-menu-cat-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #8b8fa3;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
    letter-spacing: 0.05em;
    font-weight: 700;
}

.tools-menu-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text);
    transition: background 0.2s;
}

.tools-menu-item:hover {
    background: var(--bg);
}

.tools-menu-item i {
    color: var(--primary);
    font-size: 0.9rem;
    width: 16px;
    text-align: center;
}

.tools-menu-item span {
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.3;
}

/* Responsive: 2 columns on smaller screens */
@media (max-width: 768px) {
    .tools-dropdown-menu {
        grid-template-columns: repeat(2, 1fr);
        width: 320px;
        padding: 1rem;
    }
}

/* ===== ALL TOOLS PAGE CATEGORIES ===== */
.all-tools-category-section {
    margin-bottom: 3rem;
}

.all-tools-cat-title {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.all-tools-cat-title::before {
    content: '';
    display: block;
    width: 6px;
    height: 24px;
    background: var(--primary);
    border-radius: 4px;
}

/* ===== RTL MEGA MENU FIX ===== */
[dir="rtl"] .tools-dropdown-menu {
    left: auto !important;
    right: 0 !important;
}

/* Prevent long Arabic text from breaking the grid layout */
[dir="rtl"] .tools-menu-item span {
    word-break: break-word;
    overflow-wrap: break-word;
}
/* ===== AD SLOTS (js/ads.js) ===== */
.ad-slot { text-align: center; }
.ad-slot iframe { border: 0; }