/** 
 * Tinter - Premium Mobile CSS
 */

:root {
    --bg-dark: #0f111a;
    --bg-gradient: linear-gradient(180deg, #0f111a 0%, #1a1b2e 100%);
    --primary: #ff4d6d;
    --primary-glow: rgba(255, 77, 109, 0.4);
    --secondary: #ff4d6d;
    /* PINK/MAGENTA */

    --correct-color: #06d6a0;
    --correct-glow: rgba(6, 214, 160, 0.4);

    --incorrect-color: #ef476f;
    --incorrect-glow: rgba(239, 71, 111, 0.4);

    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);

    --text-main: #ffffff;
    --text-muted: #8b92a5;

    --trap-color: #ffd60a;
    /* VIBRANT YELLOW */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body,
html {
    width: 100%;
    height: 100%;
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    background: var(--bg-gradient);
    color: var(--text-main);
    overflow: hidden;
    position: fixed;
    /* Prevent mobile pull-to-refresh */
}

/* App Container */
.app-container {
    width: 100%;
    height: 100%;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    background: var(--bg-gradient);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

/* Screens */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, transform 0.4s ease;
    transform: translateY(20px);
    display: flex;
    flex-direction: column;
    padding: 2rem;
    z-index: 1;
}

.screen.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    z-index: 10;
}

/* Intro Screen */
#intro-screen {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.logo-container {
    position: relative;
    margin-bottom: 3rem;
}

.glow-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    height: 120px;
    transform: translate(-50%, -50%);
    background: var(--primary);
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.5;
    z-index: -1;
    animation: pulse-glow 3s infinite alternate;
}

@keyframes pulse-glow {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.4;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.8;
    }
}

.logo-img { width: 80px; height: 80px; object-fit: contain; position: relative; z-index: 5; margin-bottom: 0.5rem; } .logo-icon {
    font-size: 3.5rem;
    background: -webkit-linear-gradient(45deg, var(--secondary), var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    font-weight: 700;
    font-style: italic;
    background: -webkit-linear-gradient(45deg, #fff, #ddd);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 300;
}

.instructions {
    margin-bottom: 3rem;
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

.instruction-item {
    display: flex;
    align-items: center;
    margin-bottom: 1.2rem;
    text-align: left;
}

.instruction-item:last-child {
    margin-bottom: 0;
}

.instruction-item p {
    font-size: 0.95rem;
    line-height: 1.4;
}

.icon-circle {
    min-width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 15px;
    font-size: 1.1rem;
}

.left-icon {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.right-icon {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.info-icon {
    background: rgba(255, 190, 11, 0.2);
    color: var(--trap-color);
}

.instruction-item.note p {
    color: var(--trap-color);
}

/* Buttons */
.primary-btn {
    width: 100%;
    padding: 18px;
    border-radius: 30px;
    border: none;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 10px 20px var(--primary-glow);
    transition: transform 0.2s, box-shadow 0.2s;
    outline: none;
}

.primary-btn:active {
    transform: scale(0.96);
}

.pulse-anim {
    animation: heartbeat 2s infinite;
}

@keyframes heartbeat {
    0% {
        transform: scale(1);
        box-shadow: 0 10px 20px var(--primary-glow);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 30px rgba(255, 0, 110, 0.5);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 10px 20px var(--primary-glow);
    }
}

.secondary-btn {
    display: inline-block;
    margin-top: 1rem;
    padding: 15px;
    width: 100%;
    text-align: center;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    border-radius: 30px;
    border: 1px solid var(--text-muted);
    transition: 0.2s;
}

/* === Game Screen === */
#game-screen {
    padding: 1.5rem;
}

.top-nav {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    z-index: 20;
}

.icon-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.progress-container {
    flex-grow: 1;
    margin-left: 20px;
    display: flex;
    flex-direction: column;
}

.progress-bar-bg {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

#progress-bar-fill {
    height: 100%;
    width: 10%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: right;
}

/* Game Area */
.game-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 10;
}

.words-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    width: 100%;
    margin-top: 2rem;
    margin-bottom: 2rem;
    position: relative;
    height: auto;
    min-height: 350px;
    gap: 40px;
}

/* Divider removed as per request */

.word-card {
    width: 100%;
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1rem 0;
    transition: transform 0.1s ease;
    position: relative;
    overflow: visible;
}

.left-card {
    align-items: flex-start;
    text-align: left;
    margin-left: 0;
}

.right-card {
    align-items: flex-end;
    text-align: right;
    margin-top: -5px;
    margin-right: 0;
}

.word-card.swiped-left {
    transform: translateX(-150%) scale(0.8);
    opacity: 0;
    filter: blur(5px);
    transition: all 0.4s ease;
}

.word-card.swiped-right {
    transform: translateX(150%) scale(0.8);
    opacity: 0;
    filter: blur(5px);
    transition: all 0.4s ease;
}

/* Arrows styling */
.arrow {
    font-size: 2.5rem;
    color: var(--secondary);
    /* PINK/MAGENTA */
    margin-bottom: 5px;
    line-height: 1;
    font-weight: 900;
}

.arrow-left {
    padding-left: 0;
    margin-left: -5px;
}

.arrow-right {
    padding-right: 0;
    margin-right: -5px;
}

/* Glow effects when dragged */
.word-card.highlight-left {
    transform: scale(1.02);
}

.word-card.highlight-right {
    transform: scale(1.02);
}

.word-content {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--secondary);
    /* PINK/MAGENTA */
    text-transform: uppercase;
    white-space: nowrap;
    text-shadow: none;
    letter-spacing: 1px;
    padding: 0;
}

/* The highlighted traps */
.trap {
    color: var(--trap-color);
    position: relative;
    display: inline-block;
}

.trap::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--trap-color);
    border-radius: 2px;
    box-shadow: 0 0 10px var(--trap-color);
}

/* Swipe hints removed as per request */

/* Dragger area */
.dragger-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: auto;
    margin-bottom: 2rem;
}

.dragger-track {
    width: 100%;
    height: 80px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 40px;
    border: 1px solid var(--card-border);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 5px 15px rgba(0, 0, 0, 0.3);
}

.dragger {
    width: 75px;
    height: 75px;
    background: #ffffff;
    border-radius: 50%;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    color: #000000;
    cursor: grab;
    z-index: 30;
    transition: transform 0.1s;
    touch-action: none;
    /* Prevent browser handling of drag */
}

.dragger:active {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(0.95);
}

.dragger-instructions {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Feedback Overlay */
.feedback-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, background 0.2s;
}

.feedback-overlay.show-correct {
    opacity: 1;
    background: var(--correct-glow);
}

.feedback-overlay.show-incorrect {
    opacity: 1;
    background: var(--incorrect-glow);
}

.feedback-icon {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 4rem;
    color: white;
    transform: scale(0.5);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.show-correct .feedback-icon {
    background: var(--correct-color);
    box-shadow: 0 0 50px var(--correct-color);
    transform: scale(1);
}

.show-incorrect .feedback-icon {
    background: var(--incorrect-color);
    box-shadow: 0 0 50px var(--incorrect-color);
    transform: scale(1);
}

.show-correct .feedback-icon::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

.show-incorrect .feedback-icon::after {
    content: '\f00d';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

/* === Summary Screen === */
#summary-screen {
    align-items: center;
    text-align: center;
    justify-content: flex-start;
    padding-top: 3rem;
}

.summary-header {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 4px solid var(--primary);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 0 30px var(--primary-glow);
    font-size: 2.5rem;
    font-weight: 800;
}

.score-divider {
    font-size: 1.5rem;
    margin: 0 5px;
    color: var(--text-muted);
}

#score-title {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

#score-message {
    color: var(--text-muted);
}

.mistakes-section {
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 2rem;
    max-height: 40vh;
}

.mistakes-section h3 {
    margin-bottom: 1rem;
    text-align: left;
    font-size: 1.2rem;
    color: var(--secondary);
}

.mistakes-scroll {
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 10px;
}

.mistakes-scroll::-webkit-scrollbar {
    width: 6px;
}

.mistakes-scroll::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.mistakes-scroll::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

.mistakes-list {
    list-style: none;
    text-align: left;
}

.mistake-item {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
}

.mistake-item:last-child {
    border-bottom: none;
}

.mistake-wrong {
    color: var(--incorrect-color);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.mistake-correct {
    color: var(--correct-color);
    font-size: 1.2rem;
    font-weight: 800;
}

.summary-actions {
    width: 100%;
}

/* === Level Selection === */
#level-screen {
    justify-content: center;
}

.level-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--text-main);
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    width: 100%;
}

.level-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
}

.level-btn:hover,
.level-btn:active {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
    border-color: var(--secondary);
}

.level-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.level-name {
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@media (max-width: 350px) {
    .level-grid {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(20px);
        opacity: 0;
    }
}

/* Word animations */
@keyframes popIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.pop-anim {
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
/* === ROLKA UI === */
.rolka-viewport { position: relative; height: 350px; width: 94vw; max-width: 100%; margin: 0 auto; overflow: hidden; display: flex; justify-content: center; align-items: center; perspective: 1000px; }
.rolka-track { position: absolute; top: 50%; width: 100%; transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1); transform-style: preserve-3d; }
.rolka-item { position: absolute; width: 100%; height: 60px; line-height: 60px; text-align: center; font-size: 2.64rem; font-weight: 800; color: var(--secondary); text-transform: uppercase; transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1); transform-origin: center center; top: -30px; user-select: none; }
.rolka-hints { position: absolute; width: 100%; top: 50%; transform: translateY(-50%); display: flex; justify-content: space-between; pointer-events: none; opacity: 0.15; z-index: 0; }
.hint-left { font-size: 2.5rem; color: var(--incorrect-color); }
.hint-right { font-size: 2.5rem; color: var(--correct-color); }

.rolka-item .trap::after { display: none; }

/* === Dragger Click Zones === */
.dragger-click-zone { position: absolute; top: 0; width: 50%; height: 100%; z-index: 20; cursor: pointer; }
.left-zone { left: 0; }
.right-zone { right: 0; }

/* === DOBÓR UI === */
.dobor-item { position: absolute; font-size: 1.4rem; font-weight: 600; color: var(--text-main); background: rgba(255, 255, 255, 0.05); padding: 8px 15px; border-radius: 20px; cursor: grab; user-select: none; transition: transform 0.2s, opacity 0.2s, color 0.2s; white-space: nowrap; transform: translate(0, 0); }
.dobor-item:active { cursor: grabbing; }
.dobor-item .trap::after { display: none; }

#dobor-ui { width: 100vw !important; left: 50% !important; transform: translateX(-50%) !important; overflow: hidden !important; min-height: 400px; flex-grow: 1; position: relative; }

/* Final Logo Adjustments */
.logo-container { display: flex !important; flex-direction: column !important; align-items: center !important; justify-content: center !important; }
.logo-img { width: 100px !important; height: 100px !important; object-fit: contain !important; position: relative !important; z-index: 5 !important; filter: drop-shadow(0 0 15px rgba(255, 77, 109, 0.5)) !important; }
.rolka-item.resolved-item .trap { color: var(--correct-color) !important; } .rolka-item.resolved-item .trap::after { background-color: var(--correct-color) !important; box-shadow: 0 0 10px var(--correct-color) !important; display: block !important; }
