/**
 * Forca Online - Styles
 * Desenvolvido por B20 Conteúdo Digital
 * https://www.b20.com.br
 * 
 * Design: Dark Mode Premium + Bento Grid Layout + Creative Portfolio
 * Palette: YouTube (Red + Dark Mode)
 */

/* ========================================
   CSS RESET & BASE
   ======================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ========================================
   CSS CUSTOM PROPERTIES
   ======================================== */
:root {
    /* YouTube Palette - DO NOT ALTER! */
    --primary-color: #FF0000;
    --secondary-color: #282828;
    --accent-color: #FFFFFF;
    --surface-color: #1a1a1a;
    --text-color: #FFFFFF;

    /* Automatic variations */
    --primary-hover: #cc0000;
    --primary-light: rgba(255, 0, 0, 0.15);
    --primary-glow: rgba(255, 0, 0, 0.4);

    /* Dark Mode Premium Base */
    --bg-color: #0f0f0f;
    --bg-elevated: #1a1a1a;
    --bg-card: #212121;
    --bg-hover: #2a2a2a;

    /* Text Colors */
    --text-primary: #FFFFFF;
    --text-secondary: #AAAAAA;
    --text-muted: #717171;

    /* Borders */
    --border-color: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);

    /* Status Colors */
    --success-color: #00C853;
    --success-bg: rgba(0, 200, 83, 0.15);
    --error-color: #FF5252;
    --error-bg: rgba(255, 82, 82, 0.15);
    --warning-color: #FFD600;
    --warning-bg: rgba(255, 214, 0, 0.15);
    --info-color: #2196F3;
    --info-bg: rgba(33, 150, 243, 0.15);

    /* Layout */
    --header-height: 60px;
    --bottom-nav-height: 65px;
    --border-radius: 16px;
    --border-radius-sm: 8px;
    --border-radius-lg: 24px;
    --spacing-unit: 8px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    --transition-bounce: 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-elastic: 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--primary-glow);

    /* Safe Areas */
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);

    /* Z-Index Scale */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 500;
    --z-fixed: 1000;
    --z-modal: 2000;
    --z-toast: 3000;
}

/* Light Theme Override */
[data-theme="light"] {
    --bg-color: #f5f5f5;
    --bg-elevated: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: #f0f0f0;
    --text-primary: #0f0f0f;
    --text-secondary: #606060;
    --text-muted: #909090;
    --border-color: rgba(0, 0, 0, 0.1);
    --border-hover: rgba(0, 0, 0, 0.2);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* ========================================
   BASE STYLES
   ======================================== */
html {
    font-size: clamp(14px, 2.5vw, 16px);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding-top: var(--header-height);
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    transition: transform var(--transition-fast);
}

body.shake {
    animation: bodyShake 0.3s ease-in-out;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.75rem;
}

h3 {
    font-size: 1.25rem;
}

p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ========================================
   LOADING SCREEN
   ======================================== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.loading-content {
    text-align: center;
    color: var(--text-primary);
    animation: fadeIn 0.3s ease-out;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 0, 0, 0.1);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
}

.loading-logo {
    height: 200px;
    width: auto;
    object-fit: contain;
    margin-bottom: 16px;

}

[data-theme="light"] .loading-logo {
    --logo-invert: 1;
}

.loading-content h2 {
    font-size: 2rem;
    margin-bottom: 8px;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loading-content p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ========================================
   UTILITY CLASSES & ANIMATIONS
   ======================================== */

/* Animation Classes */
.fade-in {
    animation: fadeIn var(--transition-normal) ease-out;
}

.fade-out {
    animation: fadeOut var(--transition-normal) ease-out;
}

.slide-up {
    animation: slideUp var(--transition-spring) ease-out;
}

.slide-down {
    animation: slideDown var(--transition-spring) ease-out;
}

.bounce-in {
    animation: bounceIn var(--transition-bounce) ease-out;
}

.pulse {
    animation: pulse 2s infinite;
}

.shake {
    animation: shake 0.5s ease-in-out;
}

.success-bounce {
    animation: successBounce var(--transition-elastic) ease-out;
}

.error-shake {
    animation: errorShake 0.6s ease-in-out;
}

/* Micro-interactions */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.btn-ripple:active::before {
    width: 300px;
    height: 300px;
}

/* Hover effects */
.hover-lift {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Loading states */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Touch feedback */
@media (hover: none) and (pointer: coarse) {
    .btn:active {
        transform: scale(0.98);
        transition-duration: 0.1s;
    }

    .key:active:not(:disabled) {
        transform: scale(0.95);
        transition-duration: 0.1s;
    }

    .nav-item:active {
        transform: scale(0.92);
        transition-duration: 0.1s;
    }

    .hover-lift:active {
        transform: translateY(0);
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .bounce-in,
    .pulse,
    .shake,
    .success-bounce,
    .error-shake {
        animation: none !important;
    }
}

/* Keyframe animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

@keyframes successBounce {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes errorShake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes bodyShake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-2px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(2px);
    }
}

/* ========================================
   HEADER
   ======================================== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    padding-top: var(--safe-area-top);
    box-shadow: var(--shadow-sm);
    z-index: var(--z-fixed);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.1rem;
}

.header-logo-img {
    height: 32px;
    width: auto;
    object-fit: contain;

}

[data-theme="light"] .header-logo-img {
    --logo-invert: 1;
}

.about-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
    margin-right: 12px;
    filter: brightness(0) saturate(100%) invert(var(--logo-invert, 0));
}

[data-theme="light"] .about-logo {
    --logo-invert: 1;
}

.share-logo {
    height: 42px;
    width: auto;
    object-fit: contain;
    margin-right: 10px;
    filter: brightness(0) saturate(100%) invert(var(--logo-invert, 0));
}

[data-theme="light"] .share-logo {
    --logo-invert: 1;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.header-logo h1 {
    font-size: 1.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-actions {
    display: flex;
    gap: 8px;
}

/* Desktop Navigation */
.desktop-nav {
    display: none;
}

@media (min-width: 768px) {
    .desktop-nav {
        display: flex;
        gap: 4px;
    }

    .desktop-nav .nav-link {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 10px 16px;
        border-radius: var(--border-radius-sm);
        color: var(--text-secondary);
        text-decoration: none;
        font-weight: 500;
        font-size: 0.9rem;
        transition: all var(--transition-normal);
        position: relative;
        overflow: hidden;
        cursor: pointer;
    }

    .desktop-nav .nav-link::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;

        opacity: 0;
        transition: opacity var(--transition-normal);
        border-radius: inherit;
    }

    .desktop-nav .nav-link:hover {
        color: var(--text-primary);
        transform: translateY(-1px);
        box-shadow: var(--shadow-sm);
    }

    .desktop-nav .nav-link:hover::before {
        opacity: 0.1;
    }

    .desktop-nav .nav-link.active {
        color: white;
        background: var(--primary-color);
        box-shadow: var(--shadow-sm);
    }

    .desktop-nav .nav-link.active::before {
        opacity: 1;
    }

    .desktop-nav .nav-link i {
        font-size: 1rem;
    }
}

/* ========================================
   BOTTOM NAVIGATION (Mobile Only)
   ======================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--bg-elevated);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.3);
    z-index: var(--z-fixed);
    padding-bottom: var(--safe-area-bottom);
    border-top: 1px solid var(--border-color);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.65rem;
    font-weight: 500;
    transition: all var(--transition-normal);
    min-width: 64px;
    min-height: 48px;
    border-radius: var(--border-radius-sm);
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--primary-color);
    border-radius: 0 0 2px 2px;
    transition: width var(--transition-normal);
}

.nav-item i {
    font-size: 1.25rem;
    transition: all var(--transition-spring);
}

.nav-item:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-item:active {
    transform: scale(0.95);
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item.active::before {
    width: 24px;
}

.nav-item.active i {
    transform: scale(1.15) translateY(-2px);
    filter: drop-shadow(0 2px 4px rgba(255, 0, 0, 0.3));
}

@media (min-width: 768px) {
    .bottom-nav {
        display: none !important;
    }

    body {
        padding-bottom: 0;
    }
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-normal);
    min-height: 48px;
    min-width: 48px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
    /* Hardware acceleration */
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
    transition-duration: 0.1s;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-danger {
    background: var(--error-color);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #ff3333;
    transform: translateY(-2px);
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.1rem;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-share {
    background: var(--bg-hover);
    color: var(--text-primary);
    width: 100%;
}

.btn-share:hover {
    background: var(--primary-color);
    color: white;
}

/* ========================================
   CONTAINER & LAYOUT
   ======================================== */
.container {
    width: 100%;
    max-width: 100%;
    padding: 16px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
        padding: 24px;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 960px;
    }
}

@media (min-width: 1440px) {
    .container {
        max-width: 1200px;
    }
}

.main-content {
    min-height: calc(100vh - var(--header-height) - var(--bottom-nav-height));
    margin-top: 30px;
}

/* ========================================
   SECTIONS
   ======================================== */
.section {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-spring);
}

.section.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: slideInUp var(--transition-spring) ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-header {
    text-align: center;
    margin-bottom: 24px;
}

.page-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.page-title i {
    color: var(--primary-color);
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ========================================
   BENTO GRID LAYOUT
   ======================================== */
.bento-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 640px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.bento-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 24px;
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

.bento-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.bento-large {
    grid-column: span 1;
}

@media (min-width: 640px) {
    .bento-large {
        grid-column: span 2;
    }
}

.bento-full {
    grid-column: 1 / -1;
}

.card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    border-radius: var(--border-radius-sm);
    margin-bottom: 16px;
}

.card-icon i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.bento-card h3 {
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.bento-card p {
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* ========================================
   GAME AREA
   ======================================== */
.category-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 16px;
}

.category-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.category-label i {
    color: var(--primary-color);
}

.category-select {
    flex: 1;
    padding: 12px 16px;
    font-size: 1rem;
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.category-select:hover {
    border-color: var(--primary-color);
}

.category-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Game Area Card */
.game-area {
    text-align: center;
    padding: 32px 24px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.game-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #ff6b6b, var(--primary-color));
    background-size: 200% 100%;
    animation: gradientMove 3s ease infinite;
}

@keyframes gradientMove {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* Hangman SVG */
.hangman-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 24px;
}

.hangman-svg {
    width: 100%;
    max-width: 200px;
    height: auto;
}

.hangman-part {
    stroke: var(--text-muted);
    opacity: 0;
    transform: scale(0.8);
    transform-origin: center;
    transition: all var(--transition-spring);
}

.hangman-part.visible {
    opacity: 1;
    stroke: var(--error-color);
    transform: scale(1);
    animation: partReveal 0.6s ease-out;
    filter: drop-shadow(0 0 5px rgba(255, 82, 82, 0.5));
}

@keyframes partReveal {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(45deg);
        stroke-dasharray: 100;
        stroke-dashoffset: 100;
    }

    50% {
        opacity: 0.7;
        transform: scale(1.1) rotate(0deg);
        stroke-dasharray: 100;
        stroke-dashoffset: 50;
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
        stroke-dasharray: 100;
        stroke-dashoffset: 0;
    }
}

.hangman-part.base,
.hangman-part.pole,
.hangman-part.top,
.hangman-part.rope {
    opacity: 1;
    stroke: var(--text-muted);
}

.error-counter {
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
}

#error-count {
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* Word Display */
.word-display-container {
    margin-bottom: 24px;
}

.category-hint {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--primary-light);
    border-radius: 20px;
    margin-bottom: 16px;
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 500;
}

.word-display {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    min-height: 60px;
}

.letter-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 50px;
    background: var(--bg-elevated);
    border-bottom: 3px solid var(--primary-color);
    border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.letter-slot.revealed {
    animation: revealLetter 0.3s ease;
}

@keyframes revealLetter {
    0% {
        transform: scale(0.8) rotateY(90deg);
        opacity: 0;
        background: var(--bg-elevated);
    }

    50% {
        transform: scale(1.1) rotateY(0deg);
        opacity: 1;
        background: var(--success-bg);
        box-shadow: 0 0 15px rgba(0, 200, 83, 0.3);
    }

    100% {
        transform: scale(1) rotateY(0deg);
        opacity: 1;
        background: var(--bg-elevated);
        box-shadow: none;
    }
}

.letter-slot.space {
    background: transparent;
    border: none;
    width: 20px;
}

@media (min-width: 640px) {
    .letter-slot {
        width: 48px;
        height: 60px;
        font-size: 1.75rem;
    }
}

/* Game Status */
.game-status {
    padding: 32px;
    background: var(--bg-elevated);
    border-radius: var(--border-radius);
    animation: statusAppear 0.5s ease;
}

@keyframes statusAppear {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
        filter: blur(5px);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.02) translateY(-5px);
        filter: blur(2px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
    }
}

.status-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.status-icon.win {
    color: var(--success-color);
}

.status-icon.lose {
    color: var(--error-color);
}

.status-title {
    margin-bottom: 8px;
}

.status-word {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.status-word strong {
    color: var(--primary-color);
    text-transform: uppercase;
}

/* ========================================
   VIRTUAL KEYBOARD
   ======================================== */
.keyboard-container {
    margin-bottom: 16px;
    padding: 16px;
}

.keyboard {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 500px;
    margin: 0 auto;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.key {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 44px;
    padding: 0 8px;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.key:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.key:active:not(:disabled) {
    transform: translateY(0);
}

.key:disabled {
    cursor: not-allowed;
}

.key.correct {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
    animation: successBounce var(--transition-elastic) ease-out;
    box-shadow: 0 0 10px rgba(0, 200, 83, 0.4);
}

.key.wrong {
    background: var(--error-bg);
    color: var(--error-color);
    border-color: var(--error-color);
    animation: errorShake 0.6s ease-in-out;
    box-shadow: 0 0 10px rgba(255, 82, 82, 0.3);
}

@media (min-width: 480px) {
    .key {
        min-width: 40px;
        height: 48px;
        font-size: 1.1rem;
    }
}

/* Game Controls */
.game-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ========================================
   SHARE SECTION
   ======================================== */
.share-card {
    text-align: center;
}

.share-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto 16px;
    font-size: 1.75rem;
    color: white;
}

.share-icon.whatsapp {
    background: #25D366;
}

.share-icon.telegram {
    background: #0088cc;
}

.share-icon.twitter {
    background: #1DA1F2;
}

.share-icon.facebook {
    background: #4267B2;
}

.share-icon.link {
    background: var(--primary-color);
}

.share-icon.native {
    background: linear-gradient(135deg, var(--primary-color), #ff6b6b);
}

.link-copy-container {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.share-link-input {
    flex: 1;
    padding: 12px 16px;
    font-size: 0.9rem;
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
}

/* ========================================
   STATS SECTION
   ======================================== */
.stat-card {
    text-align: center;
}

.stat-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto 16px;
    font-size: 1.5rem;
}

.stat-icon.wins {
    background: var(--success-bg);
    color: var(--success-color);
}

.stat-icon.losses {
    background: var(--error-bg);
    color: var(--error-color);
}

.stat-icon.total {
    background: var(--info-bg);
    color: var(--info-color);
}

.stat-icon.rate {
    background: var(--warning-bg);
    color: var(--warning-color);
}

.stat-icon.streak {
    background: linear-gradient(135deg, var(--primary-light), rgba(255, 107, 107, 0.2));
    color: var(--primary-color);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-sublabel {
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.category-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.category-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-elevated);
    border-radius: var(--border-radius-sm);
}

.category-stat-name {
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.category-stat-value {
    font-weight: 700;
    color: var(--primary-color);
}

/* ========================================
   SETTINGS SECTION
   ======================================== */
.setting-group {
    margin-top: 16px;
}

.setting-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 500;
}

.setting-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
}

.theme-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.theme-btn {
    flex: 1;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: var(--bg-elevated);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.theme-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.theme-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-light);
    color: var(--primary-color);
}

.theme-btn i {
    font-size: 1.5rem;
}

/* ========================================
   SETTINGS SECTIONS
   ======================================== */
.setting-section {
    width: 100%;
}

.setting-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.setting-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 10px;
    font-size: 18px;
}

.setting-title h3 {
    margin: 0 0 4px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.setting-description {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.setting-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-radius: var(--border-radius-sm);
    transition: background-color var(--transition-fast);
}

.toggle-row:hover {
    background: var(--bg-hover);
}

.toggle-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.toggle-label-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
}

.toggle-description {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 16px;
    padding: 4px;
    border-radius: var(--border-radius-sm);
}

/* Toggle Switch */
.toggle-input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
    margin: 0;
    padding: 0;
}

.toggle-slider {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    background: var(--bg-elevated);
    border: 2px solid var(--border-color);
    border-radius: 14px;
    transition: background-color var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Prevent any movement of the toggle itself */
    transform: translateZ(0);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all var(--transition-normal);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-input:checked+.toggle-slider {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
}

.toggle-input:checked+.toggle-slider::before {
    transform: translateX(24px);
    background: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.toggle-input:focus+.toggle-slider {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Specific toggle styles - ensure consistent behavior */
/* Toggles now inherit all styles from .toggle-slider base class */

/* Force toggle functionality with JavaScript fallback */
.toggle-input:not(:checked)+.toggle-slider::before {
    transform: translateX(0) !important;
}

.toggle-input:checked+.toggle-slider::before {
    transform: translateX(24px) !important;
}

/* Hover states */
.toggle-label:hover .toggle-slider {
    border-color: var(--border-hover);
}

.toggle-label:hover .toggle-input:checked+.toggle-slider {
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.4);
}

/* Active states */
.toggle-slider:active::before {
    transform: scale(0.9);
}

.toggle-input:checked+.toggle-slider:active::before {
    transform: translateX(24px) scale(0.9);
}

/* ========================================
   FAQ SECTION
   ======================================== */
.faq-section {
    margin-top: 40px;
}


.faq-section h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.faq-section h3 i {
    color: var(--primary-color);
}

.faq-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.faq-item {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    transition: all var(--transition-fast);
}

.faq-item:hover {
    border-color: var(--border-hover);
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-elevated);
    border: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.faq-question:hover {
    background: var(--bg-hover);
}

.faq-icon {
    transition: transform var(--transition-fast);
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 16px 16px;
    background: var(--bg-elevated);
}

.faq-answer p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */
.toast-container {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 16px + var(--safe-area-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

@media (min-width: 768px) {
    .toast-container {
        bottom: 24px;
    }
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    transform: translateY(100px) scale(0.9);
    opacity: 0;
    transition: all var(--transition-spring);
    pointer-events: auto;
    max-width: 90vw;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: toastSlideIn 0.4s ease-out forwards;
}

.toast.show {
    animation: toastBounce 0.6s ease-out;
}

@keyframes toastSlideIn {
    0% {
        transform: translateY(100px) scale(0.9);
        opacity: 0;
    }

    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes toastBounce {
    0% {
        transform: translateY(100px) scale(0.9);
        opacity: 0;
    }

    50% {
        transform: translateY(-5px) scale(1.02);
        opacity: 1;
    }

    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--error-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

.toast.info {
    border-left: 4px solid var(--info-color);
}

.toast i {
    font-size: 1.25rem;
}

.toast.success i {
    color: var(--success-color);
}

.toast.error i {
    color: var(--error-color);
}

.toast.warning i {
    color: var(--warning-color);
}

.toast.info i {
    color: var(--info-color);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    margin-left: auto;
    border-radius: 50%;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.toast-close i {
    font-size: 0.75rem;
}

/* ========================================
   MODAL
   ======================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

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

.modal {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transform: scale(0.9);
    transition: transform var(--transition-normal);
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 1.1rem;
    margin: 0;
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.modal-body p {
    margin: 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

/* ========================================
   FOOTER
   ======================================== */
.app-footer {
    text-align: center;
    padding: 24px 16px;
    margin-top: 32px;
    border-top: 1px solid var(--border-color);
}

.app-footer p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.app-footer p:last-child {
    margin-bottom: 0;
}

.b20-link {
    color: var(--primary-color);
    font-weight: 600;
    transition: all var(--transition-fast);
}

.b20-link:hover {
    text-decoration: underline;
    transform: scale(1.05);
}

.footer-link {
    color: var(--text-muted);
}

.footer-link:hover {
    color: var(--primary-color);
}

/* ========================================
   SKELETON LOADING
   ======================================== */
.skeleton {
    background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-hover) 50%, var(--bg-elevated) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--border-radius-sm);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ========================================
   UTILITIES
   ======================================== */
[hidden] {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.animate-pulse {
    animation: pulse 2s ease infinite;
}


.animate-shake {
    animation: shake 0.5s ease;
}

/* ========================================
   RESPONSIVE: SMALL SCREENS
   ======================================== */
@media (max-width: 480px) {

    /* Adjust Container Padding */
    .container {
        padding: 0 12px;
    }

    /* Category Selector - Prevent Overflow */
    .category-selector {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .category-select {
        width: 100%;
        max-width: 100%;
    }

    /* Compact Game Area */
    .game-area {
        padding: 16px 8px;
    }

    /* Shrink Hangman */
    .hangman-svg {
        max-width: 120px;
    }

    .hangman-container {
        margin-bottom: 12px;
    }

    /* Compact Word Display */
    .letter-slot {
        width: 28px;
        height: 38px;
        font-size: 1.2rem;
        border-bottom-width: 2px;
    }

    .letter-slot.space {
        width: 8px;
    }

    .word-display {
        gap: 3px;
        min-height: 40px;
    }

    /* Compact Keyboard */
    .keyboard-container {
        padding: 12px 4px;
        overflow-x: hidden;
        /* Prevent horizontal scroll */
    }

    .keyboard-row {
        gap: 2px;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .key {
        min-width: 0;
        flex: 1;
        max-width: 34px;
        height: 40px;
        padding: 0;
        font-size: 0.9rem;
        border-radius: 4px;
    }

    /* Adjust Buttons */
    .game-controls {
        gap: 8px;
    }

    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
        min-height: 42px;
    }

    /* Adjust Headings */
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.35rem;
    }

    h3 {
        font-size: 1.15rem;
    }

    /* Share Section - Prevent Breakage */
    .link-copy-container {
        flex-direction: column;
    }

    .link-copy-container .btn {
        width: 100%;
    }
}

/* ========================================
   HOW TO PLAY SECTION
   ======================================== */
.how-to-play-container h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    font-size: 1.2rem;
    color: var(--text-primary);
}

.how-to-play-container h3 i {
    color: var(--primary-color);
}

.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.rule-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    background: var(--bg-elevated);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    transition: transform var(--transition-fast);
}

.rule-item:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.rule-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 0, 0, 0.1);
    color: var(--primary-color);
    border-radius: 12px;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.rule-content h4 {
    margin: 0 0 4px 0;
    font-size: 1rem;
    color: var(--text-primary);
}

.rule-content p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

@media (max-width: 600px) {
    .rules-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {

    .app-header,
    .bottom-nav,
    .game-controls,
    .keyboard-container {
        display: none !important;
    }

    body {
        padding: 0;
        background: white;
        color: black;
    }
}