/* ==================== RESPONSIVE STYLES ==================== */

/* Large Desktop (1400px+) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .mindmap-node {
        transform: translate(-50%, -50%) rotate(var(--angle)) translate(250px) rotate(calc(-1 * var(--angle)));
    }
    
    .mindmap-node:hover {
        transform: translate(-50%, -50%) rotate(var(--angle)) translate(250px) rotate(calc(-1 * var(--angle))) scale(1.1);
    }
}

/* Desktop (1200px - 1399px) */
@media (max-width: 1399px) {
    :root {
        --section-padding: 80px 0;
    }
}

/* Tablet Landscape (992px - 1199px) */
@media (max-width: 1199px) {
    .influence-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .body-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .body-figure {
        order: 1;
    }
    
    .body-info {
        order: 2;
    }
    
    .mindmap-container {
        height: 450px;
    }
    
    .mindmap-node {
        width: 90px;
        height: 90px;
        transform: translate(-50%, -50%) rotate(var(--angle)) translate(180px) rotate(calc(-1 * var(--angle)));
    }
    
    .mindmap-node:hover {
        transform: translate(-50%, -50%) rotate(var(--angle)) translate(180px) rotate(calc(-1 * var(--angle))) scale(1.1);
    }
}

/* Tablet Portrait (768px - 991px) */
@media (max-width: 991px) {
    :root {
        --section-padding: 60px 0;
    }
    
    .section-header {
        margin-bottom: 40px;
    }
    
    .flip-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .choice-cards {
        gap: 25px;
    }
    
    .scanner-header {
        flex-direction: column;
        text-align: center;
    }
    
    .scanner-score {
        justify-content: center;
    }
    
    .technique-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .trash-bins {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .mindmap-container {
        height: 400px;
    }
    
    .mindmap-center {
        width: 120px;
        height: 120px;
    }
    
    .mindmap-center span {
        font-size: 0.85rem;
    }
    
    .mindmap-node {
        width: 80px;
        height: 80px;
        transform: translate(-50%, -50%) rotate(var(--angle)) translate(150px) rotate(calc(-1 * var(--angle)));
    }
    
    .mindmap-node:hover {
        transform: translate(-50%, -50%) rotate(var(--angle)) translate(150px) rotate(calc(-1 * var(--angle))) scale(1.1);
    }
    
    .mindmap-node i {
        font-size: 1.2rem;
    }
    
    .mindmap-node span {
        font-size: 0.6rem;
    }
    
    .accessibility-controls {
        top: auto;
        bottom: 90px;
        right: 10px;
    }
    
    .acc-btn {
        width: 35px;
        height: 35px;
        font-size: 0.85rem;
    }
}

/* Mobile Landscape / Small Tablet (576px - 767px) */
@media (max-width: 767px) {
    html {
        font-size: 15px;
    }
    
    .section {
        min-height: auto;
        padding: 50px 0;
    }
    
    .system-boot {
        padding: 20px;
        font-size: 0.85rem;
    }
    
    .hero-quote {
        font-size: 1rem;
    }
    
    .btn-start {
        padding: 15px 35px;
        font-size: 1rem;
    }
    
    .choice-cards {
        grid-template-columns: 1fr;
        max-width: 350px;
    }
    
    .choice-options {
        flex-direction: column;
    }
    
    .choice-btn {
        width: 100%;
    }
    
    .flip-cards-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .flip-card {
        height: 320px;
    }
    
    .scanner-buttons {
        flex-direction: column;
    }
    
    .scan-btn {
        width: 100%;
        justify-content: center;
    }
    
    .technique-options {
        grid-template-columns: 1fr;
    }
    
    .sliders-panel,
    .results-panel {
        padding: 20px;
    }
    
    .slider-group label {
        font-size: 0.9rem;
    }
    
    .situation-options {
        gap: 10px;
    }
    
    .situation-btn {
        padding: 12px 20px;
        font-size: 0.95rem;
    }
    
    .body-figure {
        max-width: 250px;
    }
    
    .body-info {
        padding: 25px;
        min-height: 250px;
    }
    
    .game-board {
        padding: 15px;
        overflow-x: auto;
    }
    
    #gameCanvas {
        min-height: 250px;
        max-height: 350px;
        max-width: 100%;
    }
    
    .mobile-controls {
        display: flex;
    }
    
    .game-stats {
        gap: 15px;
        font-size: 0.85rem;
    }
    
    .trash-items {
        padding: 15px;
        gap: 10px;
    }
    
    .trash-item {
        padding: 10px 15px;
    }
    
    .trash-item i {
        font-size: 1.2rem;
    }
    
    .trash-item span {
        font-size: 0.8rem;
    }
    
    .trash-bins {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .trash-bin {
        padding: 20px 15px;
        min-height: 100px;
    }
    
    .trash-bin i {
        font-size: 1.5rem;
    }
    
    .trash-bin span {
        font-size: 0.8rem;
    }
    
    .timeline-track {
        padding-left: 40px;
    }
    
    .timeline-track::before {
        left: 15px;
    }
    
    .timeline-icon {
        left: -40px;
        width: 30px;
        height: 30px;
    }
    
    .timeline-icon i {
        font-size: 0.85rem;
    }
    
    .timeline-content {
        padding: 20px;
    }
    
    .timeline-content h3 {
        font-size: 1.1rem;
    }
    
    .mindmap-container {
        height: 350px;
    }
    
    .mindmap-center {
        width: 100px;
        height: 100px;
    }
    
    .mindmap-center span {
        font-size: 0.75rem;
    }
    
    .mindmap-node {
        width: 65px;
        height: 65px;
        transform: translate(-50%, -50%) rotate(var(--angle)) translate(120px) rotate(calc(-1 * var(--angle)));
    }
    
    .mindmap-node:hover {
        transform: translate(-50%, -50%) rotate(var(--angle)) translate(120px) rotate(calc(-1 * var(--angle))) scale(1.1);
    }
    
    .mindmap-node i {
        font-size: 1rem;
        margin-bottom: 3px;
    }
    
    .mindmap-node span {
        font-size: 0.55rem;
    }
    
    .quiz-container {
        padding: 25px;
    }
    
    .quiz-question h3 {
        font-size: 1.2rem;
    }
    
    .quiz-options {
        flex-direction: column;
    }
    
    .quiz-option {
        width: 100%;
    }
    
    .ranking-input {
        padding: 20px;
    }
    
    .ranking-header,
    .ranking-entry {
        grid-template-columns: 40px 1fr 60px;
        font-size: 0.9rem;
    }
    
    .certificate-border {
        padding: 25px;
    }
    
    .certificate-header h2 {
        font-size: 1.4rem;
    }
    
    .certificate-title {
        font-size: 1.2rem;
    }
    
    .certificate-name {
        font-size: 1.4rem;
    }
    
    .certificate-footer {
        flex-direction: column;
        gap: 5px;
    }
    
    .share-card-phrase {
        font-size: 1.4rem;
    }
    
    .achievements-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .achievement-card {
        padding: 20px;
    }
    
    .achievement-icon {
        width: 50px;
        height: 50px;
    }
    
    .achievement-card h4 {
        font-size: 0.9rem;
    }
    
    .achievement-card p {
        font-size: 0.8rem;
    }
    
    .vapor-bot {
        bottom: 15px;
        right: 15px;
    }
    
    .bot-icon {
        width: 50px;
        height: 50px;
    }
    
    .bot-icon i {
        font-size: 1.2rem;
    }
    
    .bot-panel {
        width: 280px;
        right: -10px;
    }
    
    .progress-container {
        padding: 10px 15px;
        gap: 15px;
    }
    
    .progress-text {
        font-size: 0.75rem;
    }
    
    .footer-content {
        gap: 20px;
    }
    
    .footer-logo .glitch-text {
        font-size: 1.5rem;
    }
}

/* Mobile Portrait (max-width: 575px) */
@media (max-width: 575px) {
    html {
        font-size: 14px;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .section {
        padding: 40px 0;
    }
    
    .section-tag {
        font-size: 0.75rem;
        padding: 6px 15px;
    }
    
    .section-header {
        margin-bottom: 30px;
    }
    
    .hero-content {
        padding: 0 10px;
    }
    
    .system-boot {
        padding: 15px;
        font-size: 0.8rem;
        margin-bottom: 30px;
    }
    
    .boot-line {
        margin-bottom: 8px;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-quote {
        margin-bottom: 30px;
    }
    
    .btn-start {
        padding: 12px 30px;
        font-size: 0.95rem;
    }
    
    .scroll-indicator {
        bottom: 20px;
    }
    
    .choice-card {
        padding: 30px 20px;
    }
    
    .choice-visual {
        width: 80px;
        height: 80px;
    }
    
    .choice-visual i {
        font-size: 2.5rem;
    }
    
    .choice-card h3 {
        font-size: 1.1rem;
    }
    
    .choice-result {
        padding: 25px;
    }
    
    .result-icon {
        font-size: 2.5rem;
    }
    
    .result-text {
        font-size: 1rem;
    }
    
    .flip-card {
        height: 300px;
        -webkit-perspective: 1000px;
    }
    
    .flip-card-front,
    .flip-card-back {
        padding: 20px;
        -webkit-transform-origin: center;
        transform-origin: center;
    }
    
    .flip-card-front .card-icon {
        font-size: 2.5rem;
        margin-bottom: 15px;
    }
    
    .flip-card-front h3 {
        font-size: 1.1rem;
    }
    
    .flip-card-back h3 {
        font-size: 1rem;
    }
    
    .flip-card-back p {
        font-size: 0.85rem;
    }
    
    .stat {
        font-size: 0.75rem;
    }
    
    .stat-label {
        min-width: 100px;
    }
    
    .btn-reality {
        padding: 12px 25px;
        font-size: 0.9rem;
    }
    
    .scanner-screen {
        padding: 25px;
    }
    
    .scanner-header {
        margin-bottom: 25px;
    }
    
    .scanner-score {
        gap: 15px;
    }
    
    .score-item {
        font-size: 0.8rem;
    }
    
    .statement-text {
        font-size: 1.1rem;
    }
    
    .scan-btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .firewall-display {
        padding: 25px;
    }
    
    .phrase-text {
        font-size: 1.1rem;
    }
    
    .technique-btn {
        padding: 12px 15px;
        font-size: 0.85rem;
    }
    
    .slider-group {
        margin-bottom: 20px;
    }
    
    .slider-group label {
        font-size: 0.85rem;
    }
    
    .chart-container {
        height: 200px;
    }
    
    .metric {
        gap: 10px;
    }
    
    .metric-label {
        min-width: 110px;
        font-size: 0.8rem;
    }
    
    .situation-card {
        padding: 25px;
    }
    
    .situation-text {
        font-size: 1.1rem;
    }
    
    .body-figure {
        max-width: 200px;
    }
    
    .body-label {
        font-size: 0.65rem;
    }
    
    .body-info {
        padding: 20px;
    }
    
    .game-stats {
        flex-direction: column;
        gap: 8px;
    }
    
    .game-start h3 {
        font-size: 1.4rem;
    }
    
    .btn-game-start {
        padding: 12px 30px;
        font-size: 1rem;
    }
    
    .control-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .control-row {
        gap: 40px;
    }
    
    .trash-bins {
        grid-template-columns: 1fr 1fr;
    }
    
    .timeline-track {
        padding-left: 35px;
    }
    
    .timeline-track::before {
        left: 12px;
    }
    
    .timeline-icon {
        left: -35px;
        width: 25px;
        height: 25px;
    }
    
    .timeline-icon i {
        font-size: 0.7rem;
    }
    
    .timeline-content {
        padding: 15px;
    }
    
    .timeline-content h3 {
        font-size: 1rem;
    }
    
    .timeline-content p {
        font-size: 0.85rem;
    }
    
    .mindmap-container {
        height: 320px;
    }
    
    .mindmap-center {
        width: 85px;
        height: 85px;
    }
    
    .mindmap-center span {
        font-size: 0.65rem;
    }
    
    .mindmap-node {
        width: 55px;
        height: 55px;
        transform: translate(-50%, -50%) rotate(var(--angle)) translate(100px) rotate(calc(-1 * var(--angle)));
    }
    
    .mindmap-node:hover {
        transform: translate(-50%, -50%) rotate(var(--angle)) translate(100px) rotate(calc(-1 * var(--angle))) scale(1.1);
    }
    
    .mindmap-node i {
        font-size: 0.9rem;
        margin-bottom: 2px;
    }
    
    .mindmap-node span {
        font-size: 0.5rem;
    }
    
    .quiz-container {
        padding: 20px;
    }
    
    .quiz-question h3 {
        font-size: 1.1rem;
        margin-bottom: 20px;
    }
    
    .quiz-option {
        padding: 12px 25px;
        font-size: 1rem;
    }
    
    .ranking-header,
    .ranking-entry {
        padding: 12px 15px;
        grid-template-columns: 35px 1fr 50px;
        font-size: 0.85rem;
    }
    
    .ranking-actions {
        flex-direction: column;
    }
    
    .btn-clear-ranking,
    .btn-continue {
        width: 100%;
        justify-content: center;
    }
    
    .certificate-preview {
        padding: 15px;
    }
    
    .certificate-border {
        padding: 20px;
    }
    
    .certificate-header i {
        font-size: 2.5rem;
    }
    
    .certificate-header h2 {
        font-size: 1.2rem;
    }
    
    .certificate-title {
        font-size: 1rem;
    }
    
    .certificate-description {
        font-size: 0.85rem;
    }
    
    .certificate-name {
        font-size: 1.2rem;
    }
    
    .btn-download-cert {
        width: 100%;
        justify-content: center;
    }
    
    .share-phrases {
        gap: 8px;
    }
    
    .phrase-btn {
        font-size: 0.8rem;
        padding: 8px 15px;
    }
    
    .share-card {
        padding: 35px 20px;
    }
    
    .share-card-logo {
        font-size: 0.8rem;
    }
    
    .share-card-phrase {
        font-size: 1.2rem;
    }
    
    .btn-copy-phrase {
        width: 100%;
        justify-content: center;
    }
    
    .qr-code {
        padding: 15px;
    }
    
    .achievements-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .achievement-card {
        padding: 15px;
    }
    
    .achievement-icon {
        width: 45px;
        height: 45px;
        margin-bottom: 10px;
    }
    
    .achievement-icon i {
        font-size: 1.2rem;
    }
    
    .achievement-card h4 {
        font-size: 0.85rem;
    }
    
    .achievement-card p {
        font-size: 0.75rem;
    }
    
    .bot-panel {
        width: calc(100vw - 30px);
        max-width: 300px;
    }
    
    .accessibility-controls {
        flex-direction: row;
        bottom: 80px;
        right: 50%;
        transform: translateX(50%);
        background: var(--bg-card);
        padding: 8px;
        border-radius: 25px;
        border: var(--border-subtle);
    }
    
    .acc-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .modal-content {
        padding: 25px;
        margin: 15px;
    }
    
    .modal-icon {
        font-size: 2.5rem;
    }
    
    .modal-title {
        font-size: 1.1rem;
    }
    
    .modal-text {
        font-size: 0.9rem;
    }
    
    .footer {
        padding: 40px 0;
    }
    
    .footer-logo .glitch-text {
        font-size: 1.3rem;
    }
    
    .footer-message p {
        font-size: 0.9rem;
    }
}

/* Extra Small (max-width: 375px) */
@media (max-width: 375px) {
    .mindmap-container {
        height: 280px;
    }
    
    .mindmap-center {
        width: 70px;
        height: 70px;
    }
    
    .mindmap-center span {
        font-size: 0.55rem;
    }
    
    .mindmap-node {
        width: 45px;
        height: 45px;
        transform: translate(-50%, -50%) rotate(var(--angle)) translate(85px) rotate(calc(-1 * var(--angle)));
    }
    
    .mindmap-node:hover {
        transform: translate(-50%, -50%) rotate(var(--angle)) translate(85px) rotate(calc(-1 * var(--angle))) scale(1.1);
    }
    
    .mindmap-node i {
        font-size: 0.8rem;
    }
    
    .mindmap-node span {
        display: none;
    }
    
    .trash-bins {
        grid-template-columns: 1fr;
    }
    
    .achievements-grid {
        grid-template-columns: 1fr;
    }
}

/* Landscape Orientation for Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        min-height: auto;
        padding: 30px 20px;
    }
    
    .system-boot {
        margin-bottom: 20px;
    }
    
    .hero-quote {
        margin-bottom: 20px;
    }
    
    .scroll-indicator {
        display: none;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .progress-container,
    .vapor-bot,
    .accessibility-controls,
    .achievement-notification,
    #particles-js {
        display: none !important;
    }
    
    .section {
        page-break-inside: avoid;
    }
    
    .certificate-preview {
        border: 2px solid black;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .glitch-text::before,
    .glitch-text::after {
        /* Reduce animation intensity on high DPI */
        animation-duration: 4s;
    }
}

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

/* Dark Mode Preference (already dark, but ensure consistency) */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
    }
}
