/* AlphaRush v4 - Premium Mobile Game Experience */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
    background: #0f0f0f;
    color: #ffffff;
    overflow-x: hidden;
    user-select: none;
    -webkit-user-select: none;
    height: 100vh;
    height: 100dvh;
}

.game-app {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    max-width: 440px;
    margin: 0 auto;
    padding: 0;
    background: linear-gradient(180deg, #1a1a1a 0%, #0f0f0f 100%);
}

/* Background Effects */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 149, 0, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 193, 7, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

.bg-particles {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 2;
}

.particle-dot {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(255, 193, 7, 0.3);
    border-radius: 50%;
    animation: particleFloat 8s linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
        transform: scale(1);
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-10px) scale(0);
        opacity: 0;
    }
}

/* Header */
.app-header {
    position: relative;
    z-index: 10;
    padding: max(env(safe-area-inset-top, 20px), 20px) 24px 0;
    text-align: center;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 24px;
    min-height: 44px;
}

.header-top .game-logo {
    padding-right: 56px;
}

.game-logo {
    font-size: clamp(2rem, 8vw, 2.75rem);
    font-weight: 900;
    letter-spacing: 0.1em;
    text-shadow: 0 2px 20px rgba(255, 149, 0, 0.3);
}

.settings-button {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.settings-button:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 149, 0, 0.3);
    color: #ff9500;
    transform: translateY(-50%) scale(1.05);
}

/* Settings Modal */
.settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.settings-modal.show {
    display: flex;
    opacity: 1;
}

.settings-card {
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    backdrop-filter: blur(20px);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.settings-modal.show .settings-card {
    transform: scale(1);
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ff9500;
    margin: 0;
}

.close-button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.close-button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ff9500;
}

.settings-content {
    padding: 24px;
}

.setting-item {
    margin-bottom: 20px;
}

.setting-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 12px 0;
    transition: all 0.2s ease;
    border-radius: 8px;
}

.setting-label:hover {
    background: rgba(255, 255, 255, 0.03);
}

.setting-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    position: relative;
    appearance: none;
    transition: all 0.2s ease;
}

.setting-label input[type="checkbox"]:checked {
    background: #ff9500;
    border-color: #ff9500;
}

.setting-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.setting-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-weight: 500;
}

.settings-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.settings-version {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
}

.reset-button {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #dc3545;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reset-button:hover {
    background: rgba(220, 53, 69, 0.2);
    border-color: rgba(220, 53, 69, 0.5);
}

/* Achievement Toast */
.achievement-toast {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1001;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.95), rgba(255, 149, 0, 0.95));
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 16px;
    padding: 20px;
    max-width: 320px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(255, 149, 0, 0.3);
    transform: translateX(400px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 16px;
}

.achievement-toast.show {
    transform: translateX(0);
}

.achievement-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.achievement-content {
    flex: 1;
}

.achievement-title {
    font-size: 1rem;
    font-weight: 800;
    color: #0a0a0a;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.achievement-description {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(10, 10, 10, 0.8);
    line-height: 1.3;
}

/* Upgrade Modal */
.upgrade-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.upgrade-modal.show {
    opacity: 1;
}

.upgrade-card {
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.98), rgba(30, 30, 30, 0.95));
    border: 2px solid rgba(255, 149, 0, 0.3);
    border-radius: 24px;
    width: 90%;
    max-width: 420px;
    backdrop-filter: blur(20px);
    overflow: hidden;
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 149, 0, 0.1);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.upgrade-modal.show .upgrade-card {
    transform: scale(1);
}

.upgrade-header {
    background: linear-gradient(135deg, #ff9500, #ffc107);
    padding: 24px;
    text-align: center;
}

.upgrade-header h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0a0a0a;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.upgrade-content {
    padding: 32px 24px;
    text-align: center;
}

.upgrade-content p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 24px;
    line-height: 1.5;
}

.premium-features {
    margin: 24px 0;
    text-align: left;
}

.feature {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.pricing {
    margin: 32px 0;
    padding: 24px;
    background: rgba(255, 149, 0, 0.1);
    border: 1px solid rgba(255, 149, 0, 0.2);
    border-radius: 16px;
}

.price {
    font-size: 2rem;
    font-weight: 800;
    color: #ffc107;
    line-height: 1;
    margin-bottom: 8px;
}

.price-label {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.upgrade-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    background: rgba(0, 0, 0, 0.2);
}

.upgrade-btn {
    padding: 18px 32px;
    border: none;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.upgrade-btn.primary {
    background: linear-gradient(135deg, #ff9500, #ffc107);
    color: #0a0a0a;
    box-shadow: 0 6px 20px rgba(255, 149, 0, 0.3);
}

.upgrade-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 149, 0, 0.4);
}

.upgrade-btn.secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

.upgrade-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
}

.logo-alpha {
    color: #ff9500;
    background: linear-gradient(135deg, #ff9500, #ffb347);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-rush {
    color: #ffc107;
    background: linear-gradient(135deg, #ffc107, #ffeb3b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-metrics {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    backdrop-filter: blur(20px);
    margin: 0 auto;
    width: fit-content;
}

.metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
}

.metric-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-separator {
    width: 1px;
    height: 32px;
    background: rgba(255, 255, 255, 0.15);
}

/* Input Zone */
.input-zone {
    position: relative;
    z-index: 10;
    padding: 32px 24px 24px;
}

.word-input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    align-items: stretch;
}

.hint-button {
    background: linear-gradient(135deg, #ffc107, #ff9500);
    border: none;
    border-radius: 16px;
    padding: 0 16px;
    height: 60px;
    color: #0a0a0a;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    box-shadow: 0 4px 16px rgba(255, 193, 7, 0.3);
    min-width: 60px;
    flex: 0 0 60px;
}

.hint-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
    background: linear-gradient(135deg, #ffca28, #ffa000);
}

.hint-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.game-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
}

.game-info .separator {
    color: rgba(255, 255, 255, 0.3);
}

.puzzle-actions {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.inline-status {
    margin-top: 12px;
}

.status-message {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 12px;
    padding: 10px 12px;
    color: rgba(255,255,255,0.88);
    font-size: 0.9rem;
    line-height: 1.35;
}

.status-message.success {
    border-color: rgba(255,193,7,0.28);
    color: #ffe29a;
}

.status-message.error {
    border-color: rgba(255,107,107,0.28);
    color: #ffb3b3;
}

.app-footer {
    text-align: center;
    padding: 18px 16px 28px;
    color: rgba(255,255,255,0.55);
    font-size: 0.82rem;
}

.app-footer a {
    color: #ffb347;
    text-decoration: none;
}

.app-footer a:hover {
    text-decoration: underline;
}

.secondary-action-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.14);
    color: rgba(255,255,255,0.88);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
}

.how-to-play {
    margin-top: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 12px 14px;
    color: rgba(255,255,255,0.85);
    text-align: left;
}

.how-to-play summary {
    cursor: pointer;
    font-weight: 700;
    color: #ffb347;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.how-to-play summary::-webkit-details-marker {
    display: none;
}

.howto-arrow {
    font-size: 1rem;
    transition: transform 0.2s ease;
    color: rgba(255,255,255,0.7);
}

.how-to-play[open] .howto-arrow {
    transform: rotate(180deg);
}

.how-to-play-content {
    margin-top: 12px;
    font-size: 0.92rem;
    line-height: 1.45;
    color: rgba(255,255,255,0.78);
}

.how-to-play-content p {
    margin: 0 0 8px;
}

#word-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 60px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 0 18px;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.16em;
    color: #ffffff;
    text-transform: uppercase;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

#word-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
}

#word-input:focus {
    border-color: rgba(255, 149, 0, 0.6);
    background: rgba(255, 149, 0, 0.08);
    box-shadow: 
        0 0 0 4px rgba(255, 149, 0, 0.1),
        0 8px 32px rgba(255, 149, 0, 0.2);
    transform: translateY(-2px);
}

.submit-button {
    background: linear-gradient(135deg, #ff9500, #ff6b00);
    border: none;
    border-radius: 16px;
    padding: 0 18px;
    height: 60px;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    box-shadow: 
        0 4px 16px rgba(255, 149, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    flex: 0 0 72px;
}

.submit-button:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 8px 25px rgba(255, 149, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.submit-button:active {
    transform: translateY(-1px);
    transition: transform 0.1s;
}

.game-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.control-button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    backdrop-filter: blur(10px);
}

.control-button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

/* Words Section */
.words-section {
    position: relative;
    z-index: 10;
    flex: 1;
    padding: 0 16px;
    overflow: hidden;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
}

.words-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    max-height: 50vh;
    overflow-y: auto;
    padding-bottom: 100px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: 100%;
    box-sizing: border-box;
}

.words-grid::-webkit-scrollbar {
    display: none;
}

.word-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 16px 12px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    backdrop-filter: blur(10px);
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    overflow: hidden;
}

.word-card.completed {
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.2), rgba(255, 193, 7, 0.15));
    border-color: rgba(255, 149, 0, 0.4);
    transform: scale(1.02);
    box-shadow: 
        0 8px 32px rgba(255, 149, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.word-card.targeted {
    border-color: rgba(255, 193, 7, 0.75);
    box-shadow:
        0 0 0 2px rgba(255, 193, 7, 0.2),
        0 10px 28px rgba(255, 193, 7, 0.12);
    transform: translateY(-1px);
}

.word-card.cascade-effect {
    animation: cascadeWave 0.8s ease-out;
}

@keyframes cascadeWave {
    0% { 
        background: rgba(255, 255, 255, 0.06);
        transform: scale(1); 
    }
    50% { 
        background: rgba(255, 193, 7, 0.15);
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(255, 193, 7, 0.3);
    }
    100% { 
        background: rgba(255, 255, 255, 0.06);
        transform: scale(1); 
    }
}

.word-header {
    text-align: center;
    margin-bottom: 14px;
}

.word-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.word-card.completed .word-label {
    color: rgba(255, 255, 255, 0.9);
}

.word-letters {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.letter-cell {
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.letter-cell.revealed {
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.8), rgba(255, 107, 0, 0.7));
    border-color: rgba(255, 149, 0, 0.6);
    color: #ffffff;
    animation: letterPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 4px 12px rgba(255, 149, 0, 0.3);
}

.letter-cell.completed {
    background: linear-gradient(135deg, #ff9500, #ff6b00);
    border-color: #ff9500;
    color: #ffffff;
    box-shadow: 
        0 4px 12px rgba(255, 149, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

@keyframes letterPop {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Status Bar */
.status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(26, 26, 26, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px 24px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    backdrop-filter: blur(20px);
    z-index: 20;
}

#status-text {
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    line-height: 1.4;
}

.status-bar.success #status-text {
    color: #ffc107;
}

.status-bar.error #status-text {
    color: #ff6b6b;
}

/* Success Toast */
.success-toast {
    position: fixed;
    top: max(env(safe-area-inset-top, 20px), 20px);
    right: 24px;
    background: linear-gradient(135deg, #ff9500, #ff6b00);
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    font-weight: 600;
    transform: translateX(120%);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    box-shadow: 
        0 8px 32px rgba(255, 149, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    max-width: 280px;
}

.success-toast.show {
    transform: translateX(0);
    animation: toastBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes toastBounce {
    0% { transform: translateX(0) scale(0.9); }
    50% { transform: translateX(0) scale(1.05); }
    100% { transform: translateX(0) scale(1); }
}

.toast-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1;
    margin-bottom: 4px;
}

.toast-word {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Victory Modal */
.victory-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.victory-modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.victory-card {
    position: relative;
    background: linear-gradient(180deg, #1f1f1f 0%, #1a1a1a 100%);
    border: 1px solid rgba(255, 149, 0, 0.3);
    border-radius: 24px;
    padding: 40px 32px;
    margin: 24px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    animation: modalSlideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 24px 64px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 149, 0, 0.1);
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.victory-icon {
    font-size: 3rem;
    margin-bottom: 24px;
    line-height: 1;
}

.victory-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 32px;
    background: linear-gradient(135deg, #ff9500, #ffc107);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.final-stats {
    margin-bottom: 32px;
}

.final-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.time-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: #ffc107;
    line-height: 1;
    letter-spacing: 0.05em;
    text-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.time-unit {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 24px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ff9500;
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.victory-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.victory-btn {
    border: none;
    border-radius: 16px;
    padding: 16px 24px;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.victory-btn.primary {
    background: linear-gradient(135deg, #ff9500, #ff6b00);
    color: #ffffff;
    box-shadow: 
        0 4px 16px rgba(255, 149, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.victory-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(255, 149, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.victory-btn.secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.victory-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Medium screens - Better 2-column layout */
@media (min-width: 601px) and (max-width: 768px) {
    .words-section {
        padding: 0 12px;
    }
    
    .words-grid {
        gap: 6px;
    }
    
    .word-card {
        padding: 14px 10px;
    }
}

/* Small screens - Single column */
@media (max-width: 600px) {
    .game-app {
        padding: 0;
    }
    
    .app-header {
        padding: max(env(safe-area-inset-top, 10px), 10px) 14px 0;
    }

    .header-top {
        margin-bottom: 10px;
        min-height: 34px;
    }
    
    .header-top .game-logo {
        padding-right: 42px;
    }

    .game-logo {
        font-size: 1.5rem;
        letter-spacing: 0.06em;
    }

    .settings-button {
        width: 34px;
        height: 34px;
        font-size: 15px;
        border-radius: 10px;
    }
    
    .game-metrics {
        gap: 14px;
        margin: 0 4px;
        padding: 10px 14px;
        border-radius: 14px;
    }

    .metric-value {
        font-size: 1.1rem;
    }
    
    .metric-label {
        font-size: 0.65rem;
    }
    
    .input-zone {
        padding: 12px 12px 12px;
        position: sticky;
        bottom: 0;
        background: linear-gradient(to top, rgba(10,10,10,0.98), rgba(10,10,10,0.86));
        backdrop-filter: blur(14px);
    }
    
    .word-input-container {
        flex-direction: row;
        gap: 8px;
        align-items: stretch;
    }
    
    .submit-button {
        width: auto;
        flex: 0 0 58px;
        height: 54px;
        padding: 0 10px;
        font-size: 0.82rem;
    }

    .hint-button {
        width: auto;
        margin-top: 0;
        flex: 0 0 54px;
        height: 54px;
        padding: 0;
    }

    #word-input {
        height: 54px;
        font-size: 1rem;
        letter-spacing: 0.12em;
        padding: 0 14px;
    }

    .game-info {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        font-size: 0.72rem;
        margin-bottom: 12px;
    }

    .game-info .separator {
        display: inline;
    }

    .secondary-action-btn {
        width: 100%;
        padding: 10px 12px;
        font-size: 0.86rem;
    }

    .how-to-play {
        margin-top: 10px;
        padding: 10px 12px;
    }

    .how-to-play-content {
        font-size: 0.84rem;
    }
    
    .words-section {
        padding: 0 12px;
    }
    
    .words-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        max-height: 62vh;
        padding-bottom: 86px;
    }
    
    .success-toast {
        right: 20px;
        left: 20px;
        max-width: none;
    }

    .achievement-toast {
        right: 20px;
        left: 20px;
        max-width: none;
        transform: translateY(-100px);
    }
    
    .achievement-toast.show {
        transform: translateY(0);
    }
    
    .victory-card {
        margin: 20px;
        padding: 32px 24px;
    }
}

/* Input shake animation */
@keyframes inputShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.input-shake #word-input {
    animation: inputShake 0.5s ease-in-out;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}