/* STOJAKI - 1:1 REPLICATION OF ORIGINAL DESIGN */

:root {
    --primary: #f21441;
    --primary-dark: #b30e30;
    --bg-dark: #1e1c19;
    --sidebar-width: 360px;
    --rail-width: 64px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Open Sans', sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #eee;
    background-color: #000;
    height: 100vh;
    overflow: hidden;
    /* Lock body */
    transition: background-color 0.3s ease, color 0.3s ease;
}

:root {
    --tile-font: 'Open Sans', sans-serif;
    --tile-font-size: 21px;
    --tile-font-weight: 800;
    --racks-per-line: 3;
}

.no-animations * {
    animation: none !important;
    transition: none !important;
}

/* Backgrounds */
.sand-bg {
    background: url('../../assets/images/sand.jpg');
    background-repeat: repeat;
}

.bg-pattern-filters {
    background: url('../../assets/images/pattern-filters.jpg');
    background-repeat: repeat;
}

.bg-sand-wallpaper {
    background: url('../../assets/images/sand.jpg');
    background-repeat: repeat;
}

/* Hide triggers */
.hide-page-bg,
.hide-page-bg .sand-bg,
.hide-page-bg .bg-sand-wallpaper,
.hide-page-bg .bg-pattern-filters {
    background: #000 !important;
}

/* Specific color when BOTH are OFF */
body.hide-page-bg.hide-rack-bg {
    background-color: #8d8677 !important;
}

/* Layout */
.tool-wrapper {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}



/* Narrow Rail (fixed) */
.sidebar-rail {
    width: 64px;
    height: 100%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    border-right: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.3);
    background: #111;
    z-index: 1002;
}

.rail-top,
.rail-bottom {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.rail-bottom {
    margin-top: auto;
}

.sidebar-rail button,
.sidebar-rail i {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 44px;
    height: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
}

.rail-top,
.rail-bottom {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.rail-bottom {
    margin-top: auto;
}

.sidebar-rail button:hover,
.sidebar-rail i:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-rail button.active {
    color: var(--primary);
    background: rgba(242, 20, 65, 0.1);
}

@media (max-width: 992px) {
    .sidebar-rail {
        width: 100%;
        height: 60px;
        flex-direction: row;
        padding: 0 15px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .rail-top,
    .rail-bottom {
        flex-direction: row;
        gap: 10px;
        align-items: center;
    }

    .rail-bottom {
        margin-top: 0;
        margin-left: auto;
    }

    .sidebar-rail button,
    .sidebar-rail i {
        width: 40px;
        height: 40px;
    }
}

/* Collapsible Sidebar */
.sidebar {
    width: 360px;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    /* If filters exceed height, scroll inside sidebar only */
    padding: 2.5rem 1.5rem;
    border-right: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    background: #1a1a1a;
    z-index: 1001;
    color: #fff;
    flex-shrink: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed {
    width: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

@media (max-width: 992px) {
    .sidebar {
        width: 100%;
        max-height: 80vh;
        position: absolute;
        top: 60px;
        left: 0;
        background: #1a1a1a;
        z-index: 1000;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    }

    .sidebar.collapsed {
        width: 100%;
        max-height: 0;
        padding: 0;
        opacity: 0;
    }
}

.filter-group {
    margin-bottom: 2rem;
}

.filter-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
}

/* Buttons */
.btn-toggle,
.btn-grid {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-grid.no-wrap {
    flex-wrap: nowrap;
    justify-content: space-between;
}

.sidebar button {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 8px;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 4px;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
}

.btn-grid.no-wrap button {
    padding: 8px 4px;
}

.sidebar button.active {
    background: var(--primary);
    border-color: #fff;
    box-shadow: 0 0 15px rgba(242, 20, 65, 0.6), 0 4px 10px rgba(0, 0, 0, 0.3);
    color: #fff;
    transform: scale(1.05);
}

.sidebar button:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
}

.btn-search {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem;
    font-weight: 800;
    border-radius: 6px;
    margin-top: 1rem;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(242, 20, 65, 0.4);
    transition: transform 0.2s;
}

.sidebar input[type="text"] {
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--primary);
    padding: 10px;
    margin-bottom: 5px;
    border-radius: 4px;
    text-align: center;
    font-weight: 700;
    outline: none;
}

.main-panel {
    flex-grow: 1;
    height: 100%;
    overflow-y: auto;
    padding: 0 1rem;
    min-width: 0;
    overflow-x: hidden;
}

@media (max-width: 768px) {
    .main-panel {
        padding: 0 0.5rem;
    }
}

.quiz-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(var(--racks-per-line, 3), minmax(300px, 1fr));
    gap: 3rem 1rem;
    justify-content: center;
    justify-items: center;
    padding-top: 20px;
    padding-bottom: 50px;
}

/* Stojak Row */
.stojak-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 360px;
}

@media (max-width: 380px) {
    .stojak-row {
        transform: scale(0.9);
        transform-origin: top center;
        margin-bottom: -10%;
        /* Offset for scale */
    }
}

.rack-section {
    position: relative;
    width: 339px;
    margin-bottom: 2rem;
    transition: opacity 0.3s;
}

.rack-section.all-solved {
    opacity: 0.3;
}

.word-holder-img {
    background: url('../../assets/images/wordholder.png') no-repeat center;
    background-size: 339px 78px;
    width: 339px;
    height: 78px;
    position: relative;
}

.hide-rack-bg .word-holder-img,
.no-rack-visuals .word-holder-img {
    background-image: none !important;
}

.hide-rack-bg .rack-long {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}

/* Long Words Adaptive Rack */
.rack-long {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 12px 20px;
    width: fit-content;
    min-width: 339px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.5),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.rack-tiles {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding-top: 8px;
    /* Moved total 7px up from 14px */
    padding-left: 2px;
}

.rack-long .rack-tiles {
    padding: 0;
}

/* Common Tile Style */
.tile {
    width: 36px;
    height: 36px;
    background: #1f2223;
    color: #e6ebfe;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--tile-font);
    font-size: var(--tile-font-size);
    font-weight: var(--tile-font-weight);
    border-radius: 4px;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.3),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    user-select: none;
    cursor: grab;
}

@media (min-width: 1920px) {
    .tile {
        max-width: 36px !important;
        max-height: 36px !important;
    }
}

.tile.fixed {
    color: #54d77b;
    cursor: default;
    background: #1a1c1d;
    pointer-events: none;
    /* User cannot interact with it anymore */
    user-select: none;
}

.tile.is-hint {
    background: #313537 !important;
    /* Subtly lighter than #1f2223 */
    color: #ffd700 !important;
    /* Subtle gold tint to the letter instead of green */
}

.tile.hinted {
    border: 2px solid #ffd700;
    box-shadow:
        0 0 15px rgba(255, 215, 0, 0.4),
        0 4px 6px rgba(0, 0, 0, 0.3);
    color: #ffd700;
}

.tile.is-blank {
    background: transparent !important;
    box-shadow: none !important;
    border: none;
}

.tile.tile-ghost {
    opacity: 0.4;
    background: var(--primary);
}

.word-container {
    display: flex;
    width: 100%;
    margin-top: -14.5px;
    margin-left: -3px;
}

/* Anagram Bubble - 1:1 Original Wordblender */
.words-alternative-counter {
    position: relative;
}

.anagram-bubble {
    position: absolute;
    top: -13px;
    left: -19px;
    width: 29px;
    height: 29px;
    background: #334155;
    /* slate-700 */
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    font-size: 0.85rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 10;
    border: none;
    transition: transform 0.2s, opacity 0.5s;
}

.anagram-bubble:hover {
    transform: scale(1.1);
    background: #475569;
}

@media (max-width: 768px) {
    .rack-tiles {
        padding-left: 14px;
    }

    .anagram-bubble {
        left: -11px;
    }
}




/* Rack Actions */
.rack-actions {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 8px;
}

.rack-actions i {
    font-size: 1.25rem;
    color: #000;
    opacity: 0.5;
    cursor: pointer;
    transition: all 0.2s;
}

.rack-actions i:hover {
    opacity: 1;
    color: var(--primary);
    transform: scale(1.1);
}

/* Solved Section */
.solved-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.solved-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.word-tiles {
    display: flex;
    gap: 0;
}

.tile.solved {
    width: 25px;
    height: 25px;
    font-family: var(--tile-font);
    font-size: calc(var(--tile-font-size) * 0.75);
    font-weight: var(--tile-font-weight);
    background: #1f2223;
    /* Same as active tiles */
    color: #e6ebfe;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    /* Very subtle separator */
    border-radius: 0;
    cursor: default;
}

.word-tiles .tile.solved:first-child {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.word-tiles .tile.solved:last-child {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

.solved-row.given-up .tile.solved {
    opacity: 0.6;
    /* Slight distinction for given up words if needed */
}

.solved-actions i {
    color: #555;
    font-size: 1.1rem;
    cursor: pointer;
    transition: color 0.2s;
}

.solved-actions i:hover {
    color: var(--primary);
}

/* Modal Base Styling */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

/* Settings anchored to bottom-left as requested */
#settingsModal.modal {
    justify-content: flex-start;
    align-items: flex-end;
    padding: 0 0 30px 80px;
}

.modal-content {
    background: #141414;
    width: 90%;
    max-width: 500px;
    padding: 2.5rem;
    border-radius: 15px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
}

#settingsModal .modal-content {
    max-width: 380px;
    /* Reduced by ~half as requested */
    width: 380px;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.8rem;
    color: #444;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #fff;
}

.def-title {
    color: #95827a;
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 2rem 3rem;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.setting-item label {
    font-size: 0.75rem;
    font-weight: 900;
    color: #95827a;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.setting-item.row {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

/* Modern Sliding Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
    margin: 0 !important;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: .3s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #5e2828;
}

input:checked+.slider:before {
    transform: translateX(18px);
}

/* Select Styling */
.setting-item select {
    background: #222;
    border: 1px solid #444;
    color: #eee;
    padding: 10px;
    border-radius: 8px;
    font-weight: 500;
}

/* Range Sliders - Image Style */
.setting-item input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: #444;
    border-radius: 2px;
    outline: none;
    margin: 15px 0;
}

.setting-item input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: linear-gradient(to right, #5e2828 var(--percent, 50%), #444 var(--percent, 50%));
    border-radius: 2px;
}

.setting-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    margin-top: -10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    border: 3px solid #666;
}

/* Big Red Search/Close Button */
.btn-search {
    width: 100%;
    background: #f21441;
    color: #fff;
    border: none;
    padding: 1.5rem;
    font-size: 1.1rem;
    font-weight: 900;
    border-radius: 10px;
    margin-top: 1rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 5px 15px rgba(242, 20, 65, 0.3);
    transition: all 0.2s;
}

.btn-search:hover {
    background: #d11238;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(242, 20, 65, 0.4);
}

/* Modal Action Buttons */
.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-save,
.btn-close {
    flex: 1;
    border: none;
    padding: 1rem;
    font-size: 0.9rem;
    font-weight: 800;
    border-radius: 12px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-save {
    background: #5e2828;
    color: #fff;
    box-shadow: 0 4px 15px rgba(94, 40, 40, 0.4);
}

.btn-save:hover {
    background: #7a3535;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(94, 40, 40, 0.5);
}

.btn-close {
    background: rgba(149, 130, 122, 0.1);
    color: #95827a;
    border: 1.5px solid #95827a;
    padding: calc(1rem - 1.5px);
    /* Offset for border */
}

.btn-close:hover {
    background: #95827a;
    color: #fff;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(149, 130, 122, 0.3);
}

/* Settings Panel Specific */
.settings-panel {
    max-width: 380px;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* Stack vertically for narrower modal */
    gap: 1.8rem;
    margin-top: 1rem;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.setting-item label {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.setting-item select,
.setting-item input[type="range"] {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 8px;
    border-radius: 6px;
    outline: none;
}

.setting-item select option {
    background: var(--bg-dark);
}

/* Racks per line toggle - larger square buttons */
.racks-toggle {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
}

.racks-toggle button {
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 1.1rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s;
    flex: none;
}

.racks-toggle button:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.racks-toggle button.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 15px rgba(242, 20, 65, 0.4);
}

/* Animations */
/* Animations removed for base tiles */

@keyframes tilePop {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.hint-highlight {
    animation: tilePop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), hintPulse 0.5s ease;
}

@keyframes hintPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(242, 20, 65, 0.7);
    }

    50% {
        transform: scale(1.1);
        box-shadow: 0 0 20px 10px rgba(242, 20, 65, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(242, 20, 65, 0);
    }
}



.bubble-dissolve {
    animation: dissolve 0.5s forwards;
}

@keyframes dissolve {
    to {
        opacity: 0;
        transform: scale(2);
        filter: blur(10px);
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typing Indicator */
.typing-indicator {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: var(--primary);
    padding: 10px 25px;
    border-radius: 30px;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 3px;
    border: 2px solid var(--primary);
    box-shadow: 0 0 20px rgba(242, 20, 65, 0.4);
    z-index: 99999;
    pointer-events: none;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 50px);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}



@media (max-width: 992px) {
    .tool-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: static;
    }
}

/* ========================================
   TOP STATS BAR - Remaining/Solved Counter
   ======================================== */
.top-stats-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 1rem;
    background: #1a1a2e;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

.top-stats-bar .stats-left,
.top-stats-bar .stats-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.top-stats-bar .stat-item {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.top-stats-bar .stat-item span {
    font-weight: 700;
    color: #fff;
}

.top-stats-bar .solved-stat {
    color: #4ecdc4;
}

.top-stats-bar .solved-stat span {
    color: #4ecdc4;
}

.top-stats-bar .removed-stat {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
}

.top-stats-bar .removed-stat span {
    color: var(--primary);
}

.top-stats-bar .undo-btn {
    background: none;
    border: none;
    color: #4ecdc4;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0;
    margin-left: 2px;
    text-decoration: underline;
    transition: color 0.2s;
}

.top-stats-bar .undo-btn:hover {
    color: #fff;
}

@media (max-width: 600px) {
    .top-stats-bar {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .top-stats-bar .stats-left,
    .top-stats-bar .stats-right {
        width: 100%;
        justify-content: center;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    :root {
        --racks-per-line: 1 !important;
    }

    .top-stats-bar {
        padding: 0.5rem 1rem;
        gap: 0.75rem;
    }

    .top-stats-bar .stat-item,
    .top-stats-bar .stat-link,
    .top-stats-bar .btn-favorites {
        font-size: 0.8rem;
    }

    .quiz-container {
        grid-template-columns: 1fr;
        padding-left: 10px;
        padding-right: 10px;
    }

    .stojak-row {
        max-width: 100%;
    }
}

/* ========================================
   COLLECTIONS PANEL
   ======================================== */
#collectionsModal.modal {
    justify-content: flex-start;
    align-items: flex-end;
    padding: 0 0 30px 80px;
}

.collections-panel {
    max-width: 340px;
    width: 340px;
    position: relative;
    overflow: hidden;
}

.collections-loading,
.collections-login {
    padding: 2rem 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

.collections-loading i {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

.collections-login p {
    margin-bottom: 1.5rem;
}

.collections-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.collection-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: #fff;
}

.collection-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

.collection-item .name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.collection-item .name i {
    color: var(--primary);
    flex-shrink: 0;
}

.collection-item .count {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    min-width: 45px;
    text-align: center;
    font-weight: 600;
    flex-shrink: 0;
}

.collection-item .arrow {
    color: rgba(255, 255, 255, 0.4);
    transition: transform 0.2s;
}

.collection-item:hover .arrow {
    color: #fff;
    transform: translateX(3px);
}

/* Submenu */
.collection-submenu {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #141414;
    padding: 1.5rem;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 10;
}

.collection-submenu.show {
    transform: translateX(0);
    display: block !important;
}

.submenu-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.submenu-back {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

.submenu-back:hover {
    color: #fff;
}

#submenuTitle {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.submenu-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.submenu-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: left;
}

.submenu-option:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.submenu-option i {
    font-size: 1.25rem;
    opacity: 0.8;
}

.submenu-option:hover i {
    opacity: 1;
}

/* SCROLL TO TOP WIDGET */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(242, 20, 65, 0.3);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 12px 35px rgba(242, 20, 65, 0.5);
}

/* HIGH RESOLUTION OPTIMIZATIONS (1920px+) */
@media (min-width: 1920px) {
    .bg-sand-wallpaper {
        background-size: 60% !important;
    }

    .word-holder-img {
        filter: drop-shadow(8px 8px 16px rgba(0, 0, 0, 0.5));
        padding: 13px !important;
    }

    .tile {
        background: #1f2223 !important;
        border-radius: 5px !important;
        border: 0 !important;
        color: white !important;
        max-width: 36px !important;
        max-height: 36px !important;
    }
}