body {
    background-color: #0a192f;
    color: #ffffff;
    font-family: 'Lexend', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.word-display-container {
    position: relative;
    margin: 2rem 0;
    height: 50vh;
}

.word-display {
    font-size: 2rem;
    font-family: monospace;
    height: 100%;
    overflow: hidden;
    overflow-y: auto;
    padding: 30px 1rem;
    background: transparent;
    border: none;
    color: #8892b06c;
    line-height: 2;
}

.gradient-overlay {
    position: absolute;
    width: 100%;
    height: 90px;
    pointer-events: none;
    z-index: 1;
}

.gradient-overlay.top {
    top: 0;
    background: linear-gradient(to bottom, #0a192f 0%, transparent 100%);
}

.gradient-overlay.bottom {
    bottom: -70px;
    background: linear-gradient(to top, #0a192f 0%, transparent 100%);
}

.word-display::-webkit-scrollbar {
    width: 8px;
}

.word-display::-webkit-scrollbar-track {
    background: #112240;
    border-radius: 4px;
}

.word-display::-webkit-scrollbar-thumb {
    background: #233554;
    border-radius: 4px;
}

.word-item {
    text-align: center;
    display: inline;
    margin-right: 1rem;
    transition: all 0.2s ease;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    padding-left: 1.5rem;
    padding-bottom: 0.4rem;
}

.word-item.current {
    color: #ffffff;
    background-color: #233554;
   
    position: relative;
}

.word-item.current::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #64ffda;
    border-radius: 0 0 10px 10px;
}

.word-item.completed {
    color: #ffffff;
}

.word-item.error {
    color: #ff6b6b;
    background-color: rgba(255, 107, 107, 0.1);
}

.stats {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
    padding: 0 20px;
}

#wpm {
    font-size: 1.5rem;
    font-weight: bold;
}

#accuracy {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: right;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 1rem;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: #64ffda;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Lexend', sans-serif;
}

.logo img {
    height: 40px;
    width: auto;
}

.divider {
    width: 1px;
    height: 30px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

.nickname {
    font-size: 1.2rem;
    font-weight: 500;
    color: #8892b0;
    font-family: 'Lexend', sans-serif;
    letter-spacing: 0.5px;
    padding: 0.5rem 1rem;
    background-color: rgba(17, 34, 64, 0.5);
    border-radius: 20px;
    border: 1px solid rgba(100, 255, 218, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.timer-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.keyboard-input {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: linear-gradient(to bottom, transparent, #0a192f 20%, #071222);
    z-index: 10;
}

body.stats-mode .keyboard-input {
    display: none !important;
}

.stats-row {
    display: none; /* Mobilde gösterilecek */
}

.stats-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    min-width: 120px;
}

.stats-label {
    font-size: 0.9rem;
    color: #8892b0;
    margin-bottom: 0.3rem;
    font-family: 'Lexend', sans-serif;
}

.stats-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #64ffda;
    font-family: 'Lexend', sans-serif;
}

.keyboard-input input {
    width: 60%;
    max-width: 600px;
    padding: 20px;
    font-size: 4rem;
    border-radius: 8px;
    border: 0px;
    background-color: transparent;
    color: #ffffff;
    text-align: center;
    margin: 0 20px;
    font-family: 'Lexend', sans-serif;
    font-weight: 100;
    caret-color: #64ffda;
}

.keyboard-input input:focus {
    outline: none;
    caret-color: #64ffda;
}

.keyboard-input input::placeholder {
    color: rgba(148, 163, 184, 0.85);
    font-weight: 400;
    opacity: 1;
}

.keyboard-input input.input-error {
    color: #ff6b6b;
    text-shadow: 0 0 8px rgba(255, 107, 107, 0.35);
}

.keyboard-input input.shake-error {
    animation: input-shake 0.22s ease;
}

@keyframes input-shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    50% { transform: translateX(4px); }
    75% { transform: translateX(-2px); }
    100% { transform: translateX(0); }
}

.caps-warning {
    position: absolute;
    top: -46px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    align-items: center;
    gap: 8px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fecaca;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.caps-warning.active {
    display: inline-flex;
    animation: caps-alert 0.9s ease-in-out infinite;
}

.caps-warning-icon {
    display: inline-flex;
    color: #f87171;
}

@keyframes caps-alert {
    0% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.05); }
    100% { transform: translateX(-50%) scale(1); }
}

.timer {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.timer svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg); /* Rotate so progress starts from top */
}

.timer circle {
    fill: none;
    stroke-width: 5;
}

.timer circle.bg {
    stroke: #112240;
}

.timer circle.progress {
    stroke: #00B894;
    transition: stroke-dashoffset 0.25s linear;
}

.timer-text {
    position: absolute;
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffffff;
    font-family: 'Lexend', sans-serif;
}

h1 {
    color: #64ffda;
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(100, 255, 218, 0.3);
}

.countdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.countdown-number {
    font-size: 20rem;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
    animation: pulse 1s infinite;
    font-family: 'Lexend', sans-serif;
    letter-spacing: -10px;
    font-weight: 700;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Mobil cihazlar için düzenlemeler */
@media (max-width: 768px) {
    html,
    body {
        height: 100%;
        height: 100dvh;
        max-height: 100dvh;
        overflow: hidden;
        overscroll-behavior: none;
        touch-action: manipulation;
    }

    body {
        min-height: 0;
        position: relative;
    }

    body.stats-mode {
        overflow: auto;
        max-height: none;
        height: auto;
        min-height: 100dvh;
    }

    body.stats-mode .container {
        height: auto;
        max-height: none;
        overflow: visible;
        padding-bottom: 20px;
    }

    .container {
        padding: 12px 12px 0;
        height: 100%;
        height: 100dvh;
        max-height: 100dvh;
        min-height: 0;
        box-sizing: border-box;
        overflow: hidden;
        padding-bottom: calc(var(--mobile-practice-chrome, 84px) + 8px);
    }

    .header {
        padding: 0.35rem 0.25rem;
        margin-bottom: 0.35rem;
        align-items: center;
        gap: 0.5rem;
        position: relative;
        z-index: 120;
        flex-shrink: 0;
    }

    .logo-container {
        gap: 0.65rem;
        min-width: 0;
        flex: 1;
    }

    .logo img {
        height: 28px;
    }

    .nickname {
        font-size: 0.9rem;
        padding: 0.3rem 0.65rem;
        max-width: 42vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .timer-container {
        position: relative;
        flex-shrink: 0;
        margin-left: auto;
    }

    .timer {
        position: relative;
        top: auto;
        right: auto;
        width: 56px;
        height: 56px;
        z-index: 1;
    }

    .timer-text {
        font-size: 1.05rem;
    }

    .word-display-container {
        height: auto;
        flex: 1 1 auto;
        margin: 0.25rem 0 0;
        max-height: none;
        min-height: 0;
        padding-bottom: 0;
        overflow: hidden;
    }

    .word-display {
        height: 100%;
        max-height: 100%;
        margin-bottom: 0;
        padding: 0.75rem 0.5rem 1rem;
        font-size: 1.45rem;
        line-height: 1.55;
        text-align: center;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .gradient-overlay {
        height: 48px;
    }

    .gradient-overlay.bottom {
        bottom: 0;
    }

    /* Her satırda tek kelime */
    .word-item {
        display: block;
        width: fit-content;
        max-width: 100%;
        margin: 0.4rem auto;
        margin-right: auto;
        padding: 0.45rem 0.9rem;
        padding-left: 0.9rem;
        padding-bottom: 0.45rem;
        box-sizing: border-box;
    }

    .word-item.current::after {
        bottom: 2px;
    }

    .keyboard-input {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        flex-direction: column;
        justify-content: flex-end;
        align-items: stretch;
        gap: 0;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px) + var(--vv-keyboard-inset, 0px));
        background: #071222;
        border-top: none;
        box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.55);
        z-index: 300;
        box-sizing: border-box;
        transform: translateZ(0);
    }

    .stats-row {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: calc(78px + env(safe-area-inset-bottom, 0px) + var(--vv-keyboard-inset, 0px));
        display: flex;
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
        gap: 0.85rem;
        margin: 0;
        width: auto;
        min-width: 0;
        z-index: 310;
        pointer-events: none;
    }

    .keyboard-input > .stats-container {
        display: none;
    }

    .stats-row .stats-container {
        min-width: 0;
        flex: 0 0 auto;
        max-width: none;
        width: auto;
        padding: 0;
        background: transparent;
        border: none;
        border-radius: 0;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        align-items: flex-start;
        text-align: left;
    }

    .stats-row .stats-container:last-child {
        align-items: flex-end;
        text-align: right;
        margin-left: auto;
    }

    .stats-row .stats-label {
        font-size: 0.65rem;
        margin-bottom: 0.05rem;
        text-align: inherit;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: #8892b0;
        width: 100%;
    }

    .stats-row .stats-value {
        font-size: 1.15rem;
        text-align: inherit;
        line-height: 1.15;
        color: #64ffda;
        font-weight: 700;
        width: 100%;
    }

    .keyboard-input input {
        position: relative;
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 14px 16px;
        font-size: 1.35rem;
        font-weight: 500;
        line-height: 1.3;
        background-color: #112240;
        border: none;
        border-radius: 12px;
        color: #ffffff;
        caret-color: #64ffda;
        box-sizing: border-box;
        -webkit-appearance: none;
        appearance: none;
        box-shadow: none;
        outline: none;
    }

    .keyboard-input input:focus {
        outline: none;
        border: none;
        background-color: #163056;
        box-shadow: none;
    }

    .keyboard-input input::placeholder {
        color: #64748b;
    }

    .caps-warning {
        position: static;
        transform: none;
        align-self: center;
        order: -1;
        top: auto;
        left: auto;
        font-size: 0.78rem;
        margin-bottom: 0;
    }

    .caps-warning.active {
        animation: caps-alert-mobile 0.9s ease-in-out infinite;
    }

    @keyframes caps-alert-mobile {
        0% { transform: scale(1); }
        50% { transform: scale(1.04); }
        100% { transform: scale(1); }
    }
}

.action-buttons {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 100;
}

.action-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background-color: #112240;
    color: #64ffda;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    font-family: 'Lexend', sans-serif;
}

.action-button:hover {
    background-color: #233554;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.action-button i {
    font-size: 1.2rem;
}

/* Mobil cihazlar için düzenlemeler */
@media (max-width: 768px) {
    .action-buttons {
        top: 78px;
        left: 12px;
        right: auto;
        bottom: auto;
        flex-direction: column;
        gap: 8px;
        z-index: 320;
    }

    .action-button {
        width: 42px;
        height: 42px;
    }

    .action-button i {
        font-size: 1rem;
    }
}

.word-display.stats-mode {
    display: none;
}

.stats-display {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 2rem;
    gap: 2rem;
    background: #0a192f;
    z-index: 1000;
    overflow-y: auto;
}

.score-circle {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: linear-gradient(135deg, #64ffda 0%, #48bfe3 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 30px rgba(100, 255, 218, 0.3);
    position: relative;
    overflow: hidden;
    margin-top: 2rem;
    border: 3px solid rgba(255, 255, 255, 0.1);
}

.score-circle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
    animation: shine 2s infinite;
}

.score-circle::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, transparent 30%, rgba(0, 0, 0, 0.1) 70%);
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.score-value {
    font-size: 3.5rem;
    font-weight: 800;
    color: #0a192f;
    letter-spacing: -1px;
    line-height: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.score-label {
    font-size: 1.3rem;
    color: #0a192f;
    margin-top: 5px;
    font-weight: 600;
    letter-spacing: 0.5px;
    z-index: 1;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin: 1rem 0;
    width: 100%;
    max-width: 1000px;
}

.stat-row {
    background: rgba(255, 255, 255, 0.03);
    padding: 12px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border-color: rgba(100, 255, 218, 0.1);
}

.stat-label {
    font-size: 0.85rem;
    color: #8892b0;
    margin-bottom: 5px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.stat-value {
    font-size: 1.4rem;
    color: #64ffda;
    font-weight: 700;
    letter-spacing: -0.5px;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-row {
        padding: 10px;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    .result-buttons {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        max-width: 300px;
    }

    .result-button {
        width: 100%;
        padding: 12px 20px;
        font-size: 1rem;
    }
}

.result-buttons {
    display: flex;
    gap: 15px;
    margin-top: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    max-width: 800px;
}

.result-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    border-radius: 8px;
    border: none;
    background: rgba(100, 255, 218, 0.1);
    color: #64ffda;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(100, 255, 218, 0.2);
    min-width: 200px;
    justify-content: center;
}

.result-button:hover {
    background: rgba(100, 255, 218, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(100, 255, 218, 0.2);
}

.result-button i {
    font-size: 1.2rem;
}

.result-button.certificate {
    background: rgba(72, 191, 227, 0.1);
    color: #48bfe3;
    border-color: rgba(72, 191, 227, 0.2);
}

.result-button.certificate:hover {
    background: rgba(72, 191, 227, 0.2);
    box-shadow: 0 5px 15px rgba(72, 191, 227, 0.2);
}

.certificate-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 25, 47, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 2rem;
}

.certificate-preview {
    width: 100%;
    max-width: 800px;
    height: auto;
    background: #112240;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
}

.certificate {
    padding: 3rem;
    background: linear-gradient(135deg, #112240 0%, #0a192f 100%);
    border: 2px solid rgba(100, 255, 218, 0.1);
}

.certificate-header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.certificate-date {
    position: absolute;
    top: 0;
    right: 0;
    color: #8892b0;
    font-size: 1rem;
}

.certificate-header h1 {
    font-size: 2.5rem;
    color: #64ffda;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(100, 255, 218, 0.3);
}

.certificate-name {
    font-size: 2rem;
    color: #ffffff;
    text-align: center;
    margin: 2rem 0;
    font-weight: 600;
}

.certificate-message {
    color: #8892b0;
    text-align: center;
    font-style: italic;
    margin: 2rem 0;
    line-height: 1.6;
    font-size: 1.1rem;
    padding: 0 2rem;
}

.certificate-stats {
    margin: 3rem 0;
}

.certificate-stats h2 {
    color: #64ffda;
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.certificate-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.cert-stat-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(100, 255, 218, 0.1);
}

.cert-stat-label {
    color: #8892b0;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.cert-stat-value {
    color: #64ffda;
    font-size: 1.3rem;
    font-weight: 600;
}

.certificate-footer {
    text-align: center;
    color: #8892b0;
    font-size: 0.9rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(100, 255, 218, 0.1);
}

.certificate-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.certificate-actions button {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.download-certificate {
    background: #64ffda;
    color: #0a192f;
    font-weight: 600;
}

.download-certificate:hover {
    background: #48bfe3;
    transform: translateY(-2px);
}

.close-modal {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 768px) {
    .certificate {
        padding: 1.5rem;
    }

    .certificate-header h1 {
        font-size: 1.8rem;
    }

    .certificate-name {
        font-size: 1.5rem;
    }

    .certificate-message {
        font-size: 1rem;
        padding: 0;
    }

    .certificate-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .cert-stat-value {
        font-size: 1.1rem;
    }

    .certificate-actions {
        flex-direction: column;
        width: 100%;
    }

    .certificate-actions button {
        width: 100%;
    }
} 