/* Responsive Design for Saging sa Bahay */

/* Mobile Devices - Portrait */
@media (max-width: 768px) {
    #game-canvas {
        width: 100%;
        height: auto;
        touch-action: manipulation;
    }

    #game-container {
        touch-action: manipulation;
    }

    #ui-overlay {
        padding: 10px;
    }

    #player-stats {
        top: 10px;
        left: 10px;
        padding: 10px;
    }

    .stat-bar {
        font-size: 12px;
    }

    .stat-bar label {
        min-width: 50px;
    }

    .bar-fill {
        height: 15px;
    }

    #action-buttons {
        bottom: 10px;
        flex-wrap: wrap;
        justify-content: center;
    }

    #action-buttons button {
        padding: 8px 12px;
        font-size: 12px;
        margin: 5px;
        min-width: 80px;
    }

    #message-log {
        bottom: 10px;
        right: 10px;
        max-width: 80%;
        max-height: 120px;
        font-size: 11px;
        padding: 8px;
    }

    .menu {
        width: 95%;
        padding: 20px;
    }

    .menu h2 {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .class-options {
        flex-direction: column;
        align-items: stretch;
    }

    .class-option {
        width: 100%;
        margin-bottom: 10px;
        padding: 20px;
    }

    .class-option h3 {
        font-size: 20px;
    }

    .class-option p {
        font-size: 16px;
    }

    #kwento-popup {
        width: 95%;
        padding: 20px;
    }

    #kwento-popup .kwento-content h3 {
        font-size: 20px;
    }

    #kwento-popup .kwento-content p {
        font-size: 16px;
    }

    #kwento-popup .kwento-content button {
        padding: 12px 25px;
        font-size: 16px;
    }
}

/* Mobile Devices - Landscape */
@media (max-width: 1024px) and (orientation: landscape) {
    #game-canvas {
        height: 80vh;
        width: auto;
    }

    #ui-overlay {
        padding: 15px;
    }

    #player-stats {
        top: 15px;
        left: 15px;
    }

    #action-buttons {
        bottom: 15px;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    #game-canvas {
        width: 100%;
        height: auto;
    }

    #ui-overlay {
        padding: 5px;
    }

    #player-stats {
        top: 5px;
        left: 5px;
        padding: 8px;
    }

    .stat-bar {
        margin-bottom: 8px;
        font-size: 11px;
    }

    .stat-bar label {
        min-width: 40px;
    }

    .bar-fill {
        height: 12px;
    }

    #action-buttons {
        bottom: 5px;
    }

    #action-buttons button {
        padding: 6px 10px;
        font-size: 11px;
        margin: 3px;
        min-width: 70px;
    }

    #message-log {
        bottom: 5px;
        right: 5px;
        max-width: 75%;
        max-height: 100px;
        font-size: 10px;
        padding: 6px;
    }

    .menu {
        padding: 15px;
    }

    .menu h2 {
        font-size: 22px;
        margin-bottom: 15px;
    }

    .class-option {
        padding: 15px;
    }

    .class-option h3 {
        font-size: 18px;
    }

    .class-option p {
        font-size: 14px;
    }

    #kwento-popup {
        padding: 15px;
    }

    #kwento-popup .kwento-content h3 {
        font-size: 18px;
    }

    #kwento-popup .kwento-content p {
        font-size: 14px;
    }

    #kwento-popup .kwento-content button {
        padding: 10px 20px;
        font-size: 14px;
    }

    #start-game-btn {
        padding: 10px 25px;
        font-size: 14px;
    }
}

/* Tablet Devices */
@media (min-width: 769px) and (max-width: 1024px) {
    #game-canvas {
        width: 90%;
        height: auto;
        margin: 0 auto;
        display: block;
    }

    #game-container {
        text-align: center;
    }

    #ui-overlay {
        padding: 15px;
    }

    #player-stats {
        top: 15px;
        left: 15px;
    }

    #action-buttons {
        bottom: 15px;
    }

    .menu {
        width: 80%;
        max-width: 600px;
    }
}

/* Large Screens - Adjust canvas size */
@media (min-width: 1400px) {
    #game-canvas {
        width: 1000px;
        height: 750px;
        margin: 0 auto;
    }

    #game-container {
        text-align: center;
    }
}

/* Touch-friendly adjustments */
@media (hover: none) and (pointer: coarse) {
    #action-buttons button {
        min-height: 44px;
        /* Minimum touch target size */
    }

    .class-option {
        min-height: 80px;
    }

    #start-game-btn {
        min-height: 44px;
    }

    #kwento-popup .kwento-content button {
        min-height: 44px;
    }
}

/* Print stylesheet - for sharing concept */
@media print {
    body {
        background: white !important;
        color: black !important;
    }

    #game-canvas {
        display: none;
    }

    #ui-overlay {
        display: none;
    }

    .menu {
        position: static !important;
        transform: none !important;
        background: white !important;
        color: black !important;
        border: none !important;
        box-shadow: none !important;
        width: auto !important;
        padding: 20px !important;
    }

    #kwento-popup {
        position: static !important;
        transform: none !important;
        background: white !important;
        color: black !important;
        border: none !important;
        box-shadow: none !important;
        width: auto !important;
        padding: 20px !important;
    }

    h2, h3 {
        color: black !important;
    }

    .class-option {
        border: 1px solid #ccc !important;
        background: #f9f9f9 !important;
    }

    .class-option.selected {
        border: 2px solid #000 !important;
        background: #e6f3ff !important;
    }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }

    .bar-fill::after {
        transition: none !important;
    }

    #action-buttons button:hover {
        transform: none !important;
    }

    .class-option:hover {
        transform: none !important;
    }

    #start-game-btn:hover {
        transform: none !important;
    }
}