* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0f1f;
    min-height: 100vh;
    overflow-x: hidden;
    padding-top: 80px;
    display: flex;
    flex-direction: column;
}
:root {
    --cipher-dark-bg: #0a0f1f;
    --cipher-card-bg: #12182e;
    --cipher-neon-blue: #00d4ff;
    --cipher-neon-green: #00ff88;
    --cipher-neon-purple: #b94fff;
    --cipher-text-primary: #e8f0ff;
    --cipher-text-secondary: #8fa8c9;
    --cipher-text-muted: #5a6b85;
    --cipher-danger: #ff4757;
    --cipher-success: #00ff88;
    --cipher-warning: #ffa502;
    --cipher-spacing-md: 1.5rem;
    --cipher-spacing-lg: 2rem;
    --cipher-radius-md: 12px;
    --cipher-radius-lg: 16px;
}
/* Make body flex container */
body > * {
    flex: 1 0 auto;
}
.cipher-footer {
    flex-shrink: 0;
}
/* ========== MAIN LAYOUT WITH SIDEBAR ========== */
.cipher-layout-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
    flex: 1 0 auto;
}
.cipher-main-content {
    flex: 1;
}
/* ========== SECTION HEADER ========== */
.cipher-section-header {
    background: #132741;
    border-bottom: 2px solid rgba(0, 212, 255, 0.3);
    padding: 3rem 2rem;
    text-align: center;
    margin: 0;
}
.cipher-header-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 3px;
    color: var(--cipher-neon-blue);
    margin-bottom: 0.5rem;
}
.cipher-header-subtitle {
    font-size: 1.1rem;
    color: var(--cipher-text-secondary);
    letter-spacing: 1px;
}
/* ========== SCREENS ========== */
.cipher-screen {
    display: none;
    animation: fadeIn 0.5s ease;
}
.cipher-screen.active {
    display: block;
}
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* ========== LANDING SCREEN ========== */
.cipher-landing-content {
    text-align: center;
    padding: 4rem 2rem;
}
.cipher-logo-display {
    position: relative;
    margin-bottom: 3rem;
}
.cipher-logo-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.2) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.8; }
}
.cipher-app-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 4px;
    line-height: 1.2;
    color: var(--cipher-neon-blue);
    position: relative;
    z-index: 1;
}
.cipher-subtitle {
    font-size: 2.5rem;
    display: block;
    margin-top: 0.5rem;
    color: var(--cipher-neon-blue);
}
.cipher-tagline {
    font-size: 1.2rem;
    color: var(--cipher-text-secondary);
    margin: 1rem 0 1rem 0;
    letter-spacing: 1px;
}
.cipher-auth-section {
    margin-top: 3rem;
}
.cipher-login-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}
.cipher-login-prompt p {
    color: var(--cipher-text-secondary);
}
.cipher-already-played {
    background: rgba(255, 165, 2, 0.1);
    border: 2px solid var(--cipher-warning);
    border-radius: var(--cipher-radius-lg);
    padding: 2rem;
    margin-top: 2rem;
    text-align: center;
}
.cipher-already-played-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    color: var(--cipher-warning);
    margin-bottom: 1rem;
}
.cipher-already-played-text {
    color: var(--cipher-text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}
/* ========== BUTTONS ========== */
.cipher-btn {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: var(--cipher-radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 44px;
    letter-spacing: 1px;
}
.cipher-btn-primary {
    background: var(--cipher-neon-blue);
    color: #132741;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}
.cipher-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
}
.cipher-btn-secondary {
    background: #132741;
    color: var(--cipher-neon-blue);
    border: 2px solid var(--cipher-neon-blue);
}
.cipher-btn-secondary:hover {
    background: rgba(0, 212, 255, 0.1);
    transform: translateY(-2px);
}
.cipher-btn-danger {
    background: #132741;
    color: var(--cipher-neon-blue);
    border: 2px solid var(--cipher-neon-blue);
}
.cipher-btn-danger:hover {
    background: rgba(0, 212, 255, 0.1);
    transform: translateY(-2px);
}
.cipher-btn-text {
    background: transparent;
    color: var(--cipher-text-muted);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}
.cipher-btn-text:hover {
    color: var(--cipher-neon-blue);
}
.cipher-btn-large {
    font-size: 1.2rem;
    padding: 1.25rem 3rem;
}
.cipher-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.cipher-btn-share {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex: 1;
}
.cipher-btn-twitter {
    background: #132741;
    border: 2px solid var(--cipher-neon-blue);
    color: var(--cipher-neon-blue);
}
.cipher-btn-twitter:hover {
    background: rgba(0, 212, 255, 0.1);
}
.cipher-btn-whatsapp {
    background: #132741;
    border: 2px solid var(--cipher-neon-blue);
    color: var(--cipher-neon-blue);
}
.cipher-btn-whatsapp:hover {
    background: rgba(0, 212, 255, 0.1);
}
.cipher-btn-instagram {
    background: #132741;
    border: 2px solid var(--cipher-neon-blue);
    color: var(--cipher-neon-blue);
}
.cipher-btn-instagram:hover {
    background: rgba(0, 212, 255, 0.1);
}
/* ========== GAME SCREEN ========== */
.cipher-game-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--cipher-spacing-lg);
    flex-wrap: wrap;
    gap: var(--cipher-spacing-md);
}
.cipher-game-info {
    background: var(--cipher-card-bg);
    border-radius: var(--cipher-radius-lg);
    padding: var(--cipher-spacing-md);
    border: 1px solid rgba(0, 212, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    flex: 1;
    min-width: 100%;
}
.cipher-puzzle-date {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--cipher-neon-blue);
}
.cipher-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.5rem;
}
.cipher-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.cipher-stat-label {
    font-size: 0.8rem;
    color: var(--cipher-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.cipher-stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--cipher-neon-blue);
}
.cipher-game-content {
    display: flex;
    flex-direction: column;
    gap: var(--cipher-spacing-lg);
}
/* ========== CIPHER DISPLAY WITH TYPE ========== */
.cipher-container {
    background: var(--cipher-card-bg);
    border-radius: var(--cipher-radius-lg);
    border: 2px solid var(--cipher-neon-blue);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 150px 1fr;
}
.cipher-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.1), transparent);
    animation: scan 3s linear infinite;
    pointer-events: none;
}
@keyframes scan {
    to { left: 100%; }
}
/* ========== CIPHER TYPE SIDEBAR ========== */
.cipher-type-sidebar {
    background: #132741;
    border-right: 2px solid var(--cipher-neon-blue);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    z-index: 2;
}
.cipher-type-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 2px;
    color: var(--cipher-neon-blue);
    text-transform: uppercase;
}
.cipher-type-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--cipher-neon-blue);
    line-height: 1.2;
}
.cipher-type-description {
    font-size: 0.8rem;
    color: var(--cipher-text-muted);
    line-height: 1.4;
}
.cipher-difficulty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
}
.cipher-difficulty-label {
    font-size: 0.75rem;
    color: var(--cipher-text-muted);
    text-transform: uppercase;
}
.cipher-difficulty-stars {
    display: flex;
    gap: 2px;
}
.cipher-difficulty-star {
    font-size: 1rem;
    opacity: 0.3;
}
.cipher-difficulty-star.active {
    opacity: 1;
    color: var(--cipher-neon-blue);
}
/* ========== CIPHER TEXT DISPLAY ========== */
.cipher-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    z-index: 2;
}
.cipher-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 2px;
    color: var(--cipher-neon-blue);
    text-align: center;       /* centers the text */
}
.cipher-text {
    font-family: 'Courier New', monospace;
    font-size: 2rem;
    font-weight: 700;
    color: var(--cipher-neon-blue);
    text-align: center;
    letter-spacing: 3px;
    line-height: 1.8;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
    word-break: break-word;
}
.cipher-hint-text {
    padding: 1rem;
    background: rgba(255, 165, 2, 0.1);
    border-radius: var(--cipher-radius-md);
    border: 1px solid var(--cipher-warning);
    color: var(--cipher-warning);
    font-size: 0.9rem;
    text-align: center;
}
/* ========== INPUT & ACTIONS ========== */
.cipher-input-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.cipher-input-label {
    font-size: 0.9rem;
    color: var(--cipher-text-secondary);
    letter-spacing: 0.5px;
}
.cipher-input {
    background: var(--cipher-card-bg);
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: var(--cipher-radius-md);
    padding: 1rem;
    color: var(--cipher-text-primary);
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}
.cipher-input:focus {
    outline: none;
    border-color: var(--cipher-neon-blue);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    background: rgba(0, 212, 255, 0.05);
}
.cipher-input-feedback {
    min-height: 20px;
    font-size: 0.85rem;
    padding: 0.25rem 0;
}
.cipher-input-feedback.success {
    color: var(--cipher-neon-blue);
}
.cipher-input-feedback.error {
    color: var(--cipher-danger);
}
.cipher-input-feedback.warning {
    color: var(--cipher-warning);
}
.cipher-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.cipher-secondary-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
/* ========== SUCCESS SCREEN ========== */
.cipher-success-content {
    text-align: center;
}
.cipher-success-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    animation: bounce 0.6s ease infinite;
}
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}
.cipher-success-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: var(--cipher-neon-blue);
    margin-bottom: 1rem;
}
.cipher-success-message {
    font-size: 1.1rem;
    color: var(--cipher-text-secondary);
    margin-bottom: 2rem;
}
.cipher-score-summary {
    background: var(--cipher-card-bg);
    border-radius: var(--cipher-radius-lg);
    padding: 2rem;
    border: 1px solid rgba(0, 212, 255, 0.2);
    margin-bottom: 2rem;
    text-align: left;
}
.cipher-score-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid rgba(0, 212, 255, 0.2);
    margin-bottom: 1.5rem;
}
.cipher-score-label {
    font-size: 1rem;
    color: var(--cipher-text-secondary);
}
.cipher-score-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 900;
    color: var(--cipher-neon-blue);
}
.cipher-stats-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}
.cipher-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(0, 212, 255, 0.05);
    border-radius: var(--cipher-radius-md);
    border: 1px solid rgba(0, 212, 255, 0.1);
}
.cipher-stat-icon {
    font-size: 1.5rem;
    color: var(--cipher-neon-blue);
}
.cipher-stat-text {
    font-size: 0.85rem;
    color: var(--cipher-text-secondary);
}
.cipher-success-actions {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.cipher-share-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}
/* ========== SIDEBAR LEADERBOARD ========== */
.cipher-sidebar {
    height: fit-content;
}
.cipher-leaderboard-widget {
    background: var(--cipher-card-bg);
    border-radius: var(--cipher-radius-lg);
    border: 1px solid rgba(0, 212, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}
.cipher-leaderboard-widget-header {
    background: #132741;
    padding: 1.25rem;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}
.cipher-leaderboard-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 1px;
    color: var(--cipher-neon-blue);
    margin-bottom: 0.75rem;
}
.cipher-leaderboard-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}
.cipher-leaderboard-tab {
    padding: 0.5rem;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 6px;
    color: var(--cipher-text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}
.cipher-leaderboard-tab.active {
    background: var(--cipher-neon-blue);
    color: #132741;
    border-color: transparent;
}
.cipher-leaderboard-tab:hover {
    background: rgba(0, 212, 255, 0.2);
}
.cipher-leaderboard-content {
    padding: 1.25rem;
    max-height: 600px;
    overflow-y: auto;
}
.cipher-leaderboard-entry {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: rgba(0, 212, 255, 0.05);
    border-radius: 8px;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}
.cipher-leaderboard-entry:hover {
    background: rgba(0, 212, 255, 0.1);
    border-left-color: var(--cipher-neon-blue);
}
.cipher-leaderboard-entry.highlight {
    background: rgba(0, 212, 255, 0.1);
    border-left-color: var(--cipher-neon-blue);
}
/* Medal position styling - 1st place (Gold) */
.cipher-leaderboard-entry:nth-child(1) {
    background: rgba(255, 215, 0, 0.15);
    border-left: 3px solid #FFD700;
}
.cipher-leaderboard-entry:nth-child(1):hover {
    background: rgba(255, 215, 0, 0.25);
    border-left-color: #FFD700;
}
.cipher-leaderboard-entry:nth-child(1) .cipher-leaderboard-rank {
    color: #FFD700;
}
.cipher-leaderboard-entry:nth-child(1) .cipher-leaderboard-avatar {
    background: #FFD700;
    color: #333;
}
/* Medal position styling - 2nd place (Silver) */
.cipher-leaderboard-entry:nth-child(2) {
    background: rgba(192, 192, 192, 0.15);
    border-left: 3px solid #C0C0C0;
}
.cipher-leaderboard-entry:nth-child(2):hover {
    background: rgba(192, 192, 192, 0.25);
    border-left-color: #C0C0C0;
}
.cipher-leaderboard-entry:nth-child(2) .cipher-leaderboard-rank {
    color: #C0C0C0;
}
.cipher-leaderboard-entry:nth-child(2) .cipher-leaderboard-avatar {
    background: #C0C0C0;
    color: #333;
}
/* Medal position styling - 3rd place (Bronze) */
.cipher-leaderboard-entry:nth-child(3) {
    background: rgba(205, 127, 50, 0.15);
    border-left: 3px solid #CD7F32;
}
.cipher-leaderboard-entry:nth-child(3):hover {
    background: rgba(205, 127, 50, 0.25);
    border-left-color: #CD7F32;
}
.cipher-leaderboard-entry:nth-child(3) .cipher-leaderboard-rank {
    color: #CD7F32;
}
.cipher-leaderboard-entry:nth-child(3) .cipher-leaderboard-avatar {
    background: #CD7F32;
    color: #fff;
}
.cipher-leaderboard-rank {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: var(--cipher-neon-blue);
    min-width: 25px;
    text-align: center;
    font-size: 0.9rem;
}
.cipher-leaderboard-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--cipher-neon-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #132741;
    font-weight: 700;
    font-size: 0.75rem;
    overflow: hidden;
    flex-shrink: 0;
}
.cipher-leaderboard-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cipher-leaderboard-info {
    flex: 1;
    min-width: 0;
}
.cipher-leaderboard-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cipher-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cipher-leaderboard-score {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    color: var(--cipher-neon-blue);
    font-weight: 700;
}
/* ========== FOOTER ========== */
.cipher-footer {
    background: #132741 !important;
    border-top: 2px solid rgba(0, 212, 255, 0.2);
    padding-top: 3rem;
    margin-top: auto;
    flex-shrink: 0;
}
.cipher-footer-top {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 3rem;
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 4rem;
}
.cipher-footer-brand {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.cipher-footer-logo {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cipher-neon-blue);
}
.cipher-footer-brand-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: var(--cipher-neon-blue);
}
.cipher-footer-brand-desc {
    font-size: 0.9rem;
    color: var(--cipher-text-secondary);
    line-height: 1.6;
}
.cipher-footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}
.cipher-footer-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.cipher-footer-heading {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 1px;
    color: var(--cipher-neon-blue);
    margin: 0;
    text-transform: uppercase;
}
.cipher-footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.cipher-footer-link {
    font-size: 0.9rem;
    color: var(--cipher-text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}
.cipher-footer-link:hover {
    color: var(--cipher-neon-blue);
}
.cipher-footer-bottom {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    border-top: 1px solid rgba(0, 212, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}
.cipher-footer-copyright {
    font-size: 0.85rem;
    color: var(--cipher-text-muted);
    margin: 0;
}
.cipher-footer-socials {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}
.cipher-social-link {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cipher-text-secondary);
    transition: all 0.3s ease;
}
.cipher-social-link:hover {
    color: var(--cipher-neon-blue);
    transform: translateY(-3px);
}
.cipher-social-link svg {
    width: 100%;
    height: 100%;
}
/* ========== RESPONSIVE ========== */
@media (max-width: 1200px) {
    .cipher-layout-wrapper {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }
    .cipher-sidebar {
        display: none;
    }
    .cipher-container {
        grid-template-columns: 1fr;
    }
    .cipher-type-sidebar {
        flex-direction: row;
        gap: 1rem;
        border-right: none;
        border-bottom: 2px solid var(--cipher-neon-blue);
        padding: 1.5rem;
    }
    .cipher-type-name {
        font-size: 1.2rem;
    }
    .cipher-text {
        font-size: 1.5rem;
        letter-spacing: 2px;
    }
    .cipher-footer-top {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 1.5rem 2rem;
    }
    .cipher-footer-links {
        grid-template-columns: repeat(3, 1fr);
    }
    .cipher-footer-bottom {
        padding: 1.5rem;
    }
}
@media (max-width: 768px) {
    .cipher-header-title {
        font-size: 1.8rem;
    }
    .cipher-app-title {
        font-size: 2rem;
    }
    .cipher-stats-row {
        grid-template-columns: 1fr;
    }
    .cipher-secondary-actions {
        grid-template-columns: 1fr;
    }
    .cipher-share-buttons {
        grid-template-columns: 1fr;
    }
    .cipher-stats-summary {
        grid-template-columns: 1fr;
    }
    .cipher-type-sidebar {
        padding: 1rem;
    }
    .cipher-content {
        padding: 1.5rem;
    }
    .cipher-layout-wrapper {
        padding: 1rem;
    }
    .cipher-footer-top {
        padding: 0 1rem 2rem;
    }
    .cipher-footer-links {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    .cipher-footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding: 1rem;
    }
    .cipher-footer-copyright {
        width: 100%;
        text-align: center;
    }
    .cipher-footer-socials {
        width: 100%;
        justify-content: center;
    }
}
@media (max-width: 480px) {
    .cipher-app-title {
        font-size: 1.5rem;
    }
    .cipher-subtitle {
        font-size: 1.2rem;
    }
    .cipher-header-title {
        font-size: 1.5rem;
    }
    .cipher-text {
        font-size: 1.2rem;
        letter-spacing: 1px;
    }
    .cipher-layout-wrapper {
        padding: 0.75rem;
    }
    .cipher-footer-top {
        padding: 0 0.75rem 1.5rem;
    }
    .cipher-footer-links {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .cipher-footer-bottom {
        padding: 0.75rem;
        margin-top: 1rem;
    }
    .cipher-footer-column ul {
        gap: 0.5rem;
    }
    .cipher-footer-link {
        font-size: 0.85rem;
    }
}
/* Scrollbar styling */
.cipher-leaderboard-content::-webkit-scrollbar {
    width: 6px;
}
.cipher-leaderboard-content::-webkit-scrollbar-track {
    background: rgba(0, 212, 255, 0.05);
    border-radius: 10px;
}
.cipher-leaderboard-content::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.3);
    border-radius: 10px;
}
.cipher-leaderboard-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 212, 255, 0.5);
}
@media (max-width: 1024px) {
    .cipher-layout-wrapper {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
        max-width: 100% !important;
    }
    
    .cipher-sidebar {
        width: 100% !important;
        order: 2;  /* Push leaderboard below game content */
        margin-top: 2rem;
        border-top: 1px solid rgba(0, 255, 0, 0.2);
        padding-top: 1.5rem;
    }
    
    .cipher-main-content {
        order: 1;  /* Game content on top */
        width: 100%;
    }
    
    .cipher-leaderboard-widget {
        width: 100%;
    }
}

/* Tablets (768px - 1024px) */
@media (max-width: 768px) {
    .cipher-layout-wrapper {
        padding: 1rem !important;
        grid-template-columns: 1fr !important;
    }
    
    .cipher-letter-input {
        width: 50px !important;
        height: 50px !important;
        font-size: 20px !important;
    }
    
    .cipher-letter-inputs {
        gap: 10px;
        margin: 1.5rem 0;
    }
    
    .cipher-share-buttons {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
    
    .cipher-type-sidebar {
        min-width: 150px;
        padding-right: 1rem;
        border-right: 1px solid rgba(0, 255, 0, 0.2);
    }
    
    .cipher-leaderboard-content {
        max-height: 400px;
        overflow-y: auto;
    }
    
    .cipher-sidebar {
        margin-top: 2rem;
    }
}

/* Mobile phones (480px - 768px) */
@media (max-width: 480px) {
    .cipher-layout-wrapper {
        padding: 0.75rem !important;
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    
    .cipher-share-buttons {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .cipher-btn-share {
        padding: 0.75rem !important;
    }
    
    .cipher-btn-share span {
        display: none;  /* Hide text, show only icons */
    }
    
    .cipher-leaderboard-content {
        max-height: 350px;
        overflow-y: auto;
    }
    
    .cipher-leaderboard-widget {
        width: 100%;
    }
    
    .cipher-leaderboard-entry {
        padding: 0.5rem;
    }
    
    .cipher-letter-input {
        width: 45px !important;
        height: 45px !important;
        font-size: 18px !important;
    }
    
    .cipher-type-sidebar {
        min-width: auto;
        padding-right: 0.75rem;
    }
    
    .cipher-type-name {
        font-size: 1rem;
    }
    
    .cipher-type-description {
        font-size: 0.85rem;
    }
}

/* Extra small phones (320px) */
@media (max-width: 360px) {
    .cipher-letter-input {
        width: 40px !important;
        height: 40px !important;
        font-size: 16px !important;
    }
    
    .cipher-letter-inputs {
        gap: 8px;
    }
    
    .cipher-share-buttons {
        grid-template-columns: 1fr;
    }
    
    .cipher-leaderboard-entry {
        padding: 0.4rem;
        font-size: 0.9rem;
    }
}

/* Ensure leaderboard is always visible on mobile */
@media (max-width: 1024px) {
    .cipher-sidebar {
        display: block !important;  /* Force display */
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .cipher-leaderboard-widget {
        display: block !important;
        visibility: visible !important;
    }
}
 /* Real-time Leaderboard Highlight Animation */
        @keyframes pulse {
            0% {
                box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.4);
                transform: scale(1);
            }
            50% {
                box-shadow: 0 0 0 10px rgba(0, 255, 0, 0);
                transform: scale(1.02);
            }
            100% {
                box-shadow: 0 0 0 0 rgba(0, 255, 0, 0);
                transform: scale(1);
            }
        }

        @keyframes slideInHighlight {
            from {
                opacity: 0;
                background: rgba(0, 255, 0, 0.3);
            }
            to {
                opacity: 1;
                background: rgba(0, 255, 0, 0.1);
            }
        }

        .cipher-leaderboard-entry.highlight {
            background: rgba(0, 255, 0, 0.1);
            border: 2px solid rgba(0, 255, 0, 0.4);
            border-radius: 8px;
            padding: 0.75rem;
            animation: slideInHighlight 0.5s ease-out;
        }

        .cipher-leaderboard-entry.highlight:hover {
            background: rgba(0, 255, 0, 0.15);
            box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
        }

        .cipher-leaderboard-entry.highlight .cipher-leaderboard-rank {
            color: var(--cipher-neon-green);
            font-weight: bold;
            text-shadow: 0 0 8px rgba(0, 255, 0, 0.6);
        }

        .cipher-leaderboard-entry.highlight .cipher-leaderboard-name {
            color: var(--cipher-neon-green);
            font-weight: bold;
        }

        .cipher-leaderboard-entry.highlight .cipher-leaderboard-score {
            color: var(--cipher-neon-green);
            font-weight: bold;
            font-size: 1.1rem;
        }

        /* Letter Input Styles */
        .cipher-letter-inputs {
            display: flex;
            gap: 15px;
            justify-content: center;
            margin: 2rem 0;
            flex-wrap: wrap;
        }

        .cipher-letter-input {
            width: 60px !important;
            height: 60px !important;
            font-size: 24px !important;
            text-align: center !important;
            font-weight: bold !important;
            border: 2px solid var(--cipher-neon-green) !important;
            border-radius: 8px !important;
            background: rgba(0, 255, 0, 0.05) !important;
            color: var(--cipher-neon-green) !important;
            transition: all 0.3s ease;
        }

        .cipher-letter-input:focus {
            outline: none;
            border-color: var(--cipher-neon-green) !important;
            box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
            background: rgba(0, 255, 0, 0.1) !important;
        }

        .cipher-letter-input:disabled {
            border-color: var(--cipher-success) !important;
            background: rgba(0, 255, 0, 0.2) !important;
            color: var(--cipher-success) !important;
            cursor: not-allowed;
        }

        .cipher-letter-input::placeholder {
            color: var(--cipher-text-muted);
            font-weight: normal;
        }

        /* Fix cipher type sidebar text overlap */
        .cipher-type-sidebar {
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
            min-width: 200px;
            padding-right: 1.5rem;
            border-right: 1px solid rgba(0, 255, 0, 0.2);
        }

        .cipher-type-sidebar > div {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .cipher-type-label,
        .cipher-difficulty-label {
            font-size: 0.75rem;
            color: var(--cipher-text-muted);
            letter-spacing: 1px;
            text-transform: uppercase;
            margin-bottom: 0.25rem;
        }

        .cipher-type-name {
            font-size: 1.1rem;
            font-weight: bold;
            color: var(--cipher-neon-green);
            word-wrap: break-word;
        }

        .cipher-type-description {
            font-size: 0.9rem;
            color: var(--cipher-text-muted);
            word-wrap: break-word;
            line-height: 1.3;
        }

        /* Social Share Buttons with Brand Colors */
        .cipher-share-buttons {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
            gap: 1rem;
            margin-bottom: 1.5rem;
            width: 100%;
        }

        .cipher-btn-share {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            padding: 0.75rem 1.5rem !important;
            font-size: 0.95rem;
            font-weight: 600;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s ease;
            color: white;
            text-decoration: none;
        }

        .cipher-share-icon {
            width: 20px;
            height: 20px;
            display: inline-block;
        }

        /* Facebook - Blue */
        .cipher-btn-facebook {
            background: #1877F2;
            border: 2px solid #1877F2;
        }

        .cipher-btn-facebook:hover {
            background: #165ec4;
            border-color: #165ec4;
            box-shadow: 0 0 15px rgba(24, 119, 242, 0.5);
            transform: translateY(-2px);
        }

        /* Twitter - Black/Dark Gray */
        .cipher-btn-twitter {
            background: #000000;
            border: 2px solid #000000;
        }

        .cipher-btn-twitter:hover {
            background: #1a1a1a;
            border-color: #1a1a1a;
            box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
            transform: translateY(-2px);
        }

        /* Instagram - Gradient (Pink to Purple) */
        .cipher-btn-instagram {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border: 2px solid #667eea;
        }

        .cipher-btn-instagram:hover {
            background: linear-gradient(135deg, #5568d3 0%, #6a3f91 100%);
            border-color: #5568d3;
            box-shadow: 0 0 15px rgba(102, 126, 234, 0.5);
            transform: translateY(-2px);
        }

        /* WhatsApp - Green */
        .cipher-btn-whatsapp {
            background: #25D366;
            border: 2px solid #25D366;
        }

        .cipher-btn-whatsapp:hover {
            background: #1fb355;
            border-color: #1fb355;
            box-shadow: 0 0 15px rgba(37, 211, 102, 0.5);
            transform: translateY(-2px);
        }

        .cipher-btn-share:active {
            transform: translateY(0);
        }

        @media (max-width: 768px) {
            .cipher-letter-input {
                width: 50px !important;
                height: 50px !important;
                font-size: 20px !important;
            }

            .cipher-letter-inputs {
                gap: 10px;
            }

            .cipher-share-buttons {
                grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
            }

            .cipher-type-sidebar {
                min-width: 150px;
                padding-right: 1rem;
            }
        }

        @media (max-width: 480px) {
            .cipher-share-buttons {
                grid-template-columns: 1fr 1fr;
            }

            .cipher-btn-share span {
                display: none;
            }

            .cipher-btn-share {
                padding: 0.75rem !important;
            }
        }