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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: url('images/background.webp') center center / cover no-repeat fixed;
    color: #fff;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: -1;
    pointer-events: none;
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.game-header {
    text-align: center;
    margin-bottom: 30px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

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

.header-top h1 {
    flex: 1;
    margin: 0;
}

.game-header h1:not(.game-title) {
    font-size: 3em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
}

.game-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: 'Cinzel', 'MedievalSharp', 'Uncial Antiqua', serif;
    font-weight: 700;
    font-size: 1em; /* Reset font size */
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.logo-image {
    height: 45px;
    max-width: 45px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));
    flex-shrink: 0;
}

.game-title-text {
    font-family: 'Cinzel', 'MedievalSharp', 'Uncial Antiqua', serif;
    font-weight: 700;
    font-size: 2.2em;
    line-height: 1;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 50%, #d35400 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    color: #f39c12; /* Fallback color if gradient doesn't work */
}

.health-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.health-label {
    font-size: 1.2em;
    font-weight: bold;
}

.health-bar-container {
    width: 100%;
    max-width: 400px;
}

.health-bar {
    position: relative;
    width: 100%;
    height: 40px;
    background: #2a2a3e;
    border: 3px solid #4a4a6e;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.health-fill {
    height: 100%;
    background: linear-gradient(90deg, #e74c3c 0%, #c0392b 100%);
    transition: width 0.5s ease, background 0.5s ease;
    width: 100%;
}

.health-fill.low {
    background: linear-gradient(90deg, #e74c3c 0%, #c0392b 100%);
}

.health-fill.medium {
    background: linear-gradient(90deg, #f39c12 0%, #e67e22 100%);
}

.health-fill.high {
    background: linear-gradient(90deg, #27ae60 0%, #229954 100%);
}

.health-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    font-size: 1.1em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    z-index: 1;
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.stat-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 25px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.stat-label {
    font-weight: bold;
    margin-right: 10px;
}

.stat-value {
    color: #f39c12;
    font-weight: bold;
    font-size: 1.2em;
}

.game-history {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.history-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.history-label {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.8);
}

.history-value {
    color: #9b59b6;
    font-weight: bold;
    font-size: 1.1em;
}

.discard-pile-container,
.deck-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.section-title {
    font-size: 1.8em;
    color: #f39c12;
    margin-bottom: 20px;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.discard-cards,
.deck-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.discard-cards .room-item,
.deck-cards .room-item {
    width: 100%;
    height: auto;
    cursor: default;
    opacity: 1;
}

.discard-cards .room-item:hover,
.deck-cards .room-item:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(243, 156, 18, 0.6);
}

.room-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.room-title {
    text-align: center;
    font-size: 2em;
    margin-bottom: 25px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.room-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.room-item {
    position: relative;
    background: transparent;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 0;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.room-item.weapon {
    border-color: #3498db;
}

.room-item.monster {
    border-color: #e74c3c;
}

.room-item.potion {
    border-color: #27ae60;
}

.room-item:hover:not(.interacted) {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.room-item.weapon:hover:not(.interacted) {
    border-color: #5dade2;
    box-shadow: 0 8px 16px rgba(52, 152, 219, 0.4),
                0 0 20px rgba(52, 152, 219, 0.6),
                0 0 30px rgba(52, 152, 219, 0.4);
    animation: glow-pulse-blue 1.5s ease-in-out infinite;
}

.room-item.monster:hover:not(.interacted) {
    border-color: #ec7063;
    box-shadow: 0 8px 16px rgba(231, 76, 60, 0.4),
                0 0 20px rgba(231, 76, 60, 0.6),
                0 0 30px rgba(231, 76, 60, 0.4);
    animation: glow-pulse-red 1.5s ease-in-out infinite;
}

.room-item.potion:hover:not(.interacted) {
    border-color: #58d68d;
    box-shadow: 0 8px 16px rgba(39, 174, 96, 0.4),
                0 0 20px rgba(39, 174, 96, 0.6),
                0 0 30px rgba(39, 174, 96, 0.4);
    animation: glow-pulse-green 1.5s ease-in-out infinite;
}

@keyframes glow-pulse-blue {
    0%, 100% {
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4),
                    0 0 20px rgba(52, 152, 219, 0.6),
                    0 0 30px rgba(52, 152, 219, 0.4);
    }
    50% {
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4),
                    0 0 25px rgba(52, 152, 219, 0.8),
                    0 0 40px rgba(52, 152, 219, 0.6);
    }
}

@keyframes glow-pulse-red {
    0%, 100% {
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4),
                    0 0 20px rgba(231, 76, 60, 0.6),
                    0 0 30px rgba(231, 76, 60, 0.4);
    }
    50% {
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4),
                    0 0 25px rgba(231, 76, 60, 0.8),
                    0 0 40px rgba(231, 76, 60, 0.6);
    }
}

@keyframes glow-pulse-green {
    0%, 100% {
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4),
                    0 0 20px rgba(39, 174, 96, 0.6),
                    0 0 30px rgba(39, 174, 96, 0.4);
    }
    50% {
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4),
                    0 0 25px rgba(39, 174, 96, 0.8),
                    0 0 40px rgba(39, 174, 96, 0.6);
    }
}

.room-item.interacted {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: rgba(127, 127, 127, 0.5);
}

.item-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.room-item:hover:not(.interacted) .item-image {
    transform: scale(1.1);
}

.room-item.interacted .item-image {
    opacity: 0.5;
    filter: grayscale(100%) drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));
}

.item-icon {
    font-size: 4em;
    margin-bottom: 10px;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));
}

.value-circle {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4em;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.value-circle.red {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.value-circle.blue {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.value-circle.green {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
}

.room-item.interacted .value-circle {
    opacity: 0.5;
    filter: grayscale(100%);
}

.room-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.btn {
    padding: 15px 30px;
    font-size: 1.2em;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

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

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

.btn-run {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: white;
}

.btn-run:hover:not(:disabled) {
    background: linear-gradient(135deg, #b2babb 0%, #95a5a6 100%);
}

.btn-proceed {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
}

.btn-proceed:hover:not(:disabled) {
    background: linear-gradient(135deg, #58d68d 0%, #27ae60 100%);
}

.btn-restart {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    margin-top: 20px;
}

.btn-restart:hover {
    background: linear-gradient(135deg, #5dade2 0%, #3498db 100%);
}

.btn-restart-header {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.3);
    color: white;
    border: 2px solid rgba(231, 76, 60, 0.5);
    font-size: 1.5em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.btn-restart-header:hover {
    background: rgba(231, 76, 60, 0.5);
    border-color: rgba(231, 76, 60, 0.8);
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.6);
}

.message-area {
    min-height: 60px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.message {
    padding: 10px;
    margin: 5px 0;
    border-radius: 5px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.info {
    background: rgba(52, 152, 219, 0.2);
    border-left: 3px solid #3498db;
}

.message.success {
    background: rgba(39, 174, 96, 0.2);
    border-left: 3px solid #27ae60;
}

.message.warning {
    background: rgba(243, 156, 18, 0.2);
    border-left: 3px solid #f39c12;
}

.message.error {
    background: rgba(231, 76, 60, 0.2);
    border-left: 3px solid #e74c3c;
}

.game-over-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.game-over-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    border: 3px solid #f39c12;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.game-over-content h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
    color: #f39c12;
}

.game-over-content p {
    font-size: 1.2em;
    margin-bottom: 15px;
}

.final-score {
    font-size: 1.5em;
    font-weight: bold;
    color: #f39c12;
    margin: 20px 0;
}

.final-score span {
    font-size: 1.2em;
    color: #fff;
}

.remaining-cards-title {
    font-size: 1.3em;
    color: #f39c12;
    margin: 25px 0 15px 0;
    font-weight: bold;
}

.remaining-cards-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 2px solid rgba(243, 156, 18, 0.3);
    max-height: 400px;
    overflow-y: auto;
}

.remaining-cards-container .room-item {
    width: 120px;
    height: auto;
    cursor: default;
    opacity: 1;
}

.remaining-cards-container .room-item:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(243, 156, 18, 0.6);
}

.choice-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    backdrop-filter: blur(5px);
}

.choice-content {
    background: rgba(0, 0, 0, 0.4);
    padding: 35px;
    border-radius: 15px;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.2);
    max-width: 550px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.choice-content h2 {
    font-size: 1.8em;
    margin-bottom: 15px;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    font-weight: bold;
}

.monster-info {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 25px;
    padding: 12px;
    background: rgba(231, 76, 60, 0.2);
    border: 2px solid rgba(231, 76, 60, 0.4);
    border-radius: 10px;
    color: #e74c3c;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.choice-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.choice-buttons .btn {
    flex: 1;
    min-width: 180px;
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border-radius: 10px;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.choice-title {
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.choice-damage {
    font-size: 1.4em;
    color: #e74c3c;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.choice-note {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 5px;
    font-style: italic;
}

.btn-barehanded {
    background: rgba(149, 165, 166, 0.2);
    color: white;
    border-color: rgba(149, 165, 166, 0.4) !important;
}

.btn-barehanded:hover:not(:disabled) {
    background: rgba(149, 165, 166, 0.3);
    border-color: rgba(149, 165, 166, 0.6) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.btn-weapon {
    background: rgba(52, 152, 219, 0.2);
    color: white;
    border-color: rgba(52, 152, 219, 0.4) !important;
}

.btn-weapon:hover:not(:disabled) {
    background: rgba(52, 152, 219, 0.3);
    border-color: rgba(52, 152, 219, 0.6) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.btn-weapon:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(149, 165, 166, 0.1);
    border-color: rgba(149, 165, 166, 0.2) !important;
}

.btn-cancel {
    background: rgba(149, 165, 166, 0.15);
    color: white;
    margin-top: 15px;
    padding: 12px 30px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 1em;
}

.btn-cancel:hover {
    background: rgba(149, 165, 166, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.btn-help {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(52, 152, 219, 0.3);
    color: white;
    border: 2px solid rgba(52, 152, 219, 0.5);
    font-size: 1.5em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.btn-help:hover {
    background: rgba(52, 152, 219, 0.5);
    border-color: rgba(52, 152, 219, 0.8);
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.6);
}

.btn-settings {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(155, 89, 182, 0.3);
    color: white;
    border: 2px solid rgba(155, 89, 182, 0.5);
    font-size: 1.5em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.btn-settings:hover {
    background: rgba(155, 89, 182, 0.5);
    border-color: rgba(155, 89, 182, 0.8);
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(155, 89, 182, 0.6);
}

.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1003;
    backdrop-filter: blur(5px);
}

.settings-content {
    background: rgba(0, 0, 0, 0.4);
    padding: 35px;
    border-radius: 15px;
    text-align: center;
    border: 2px solid rgba(155, 89, 182, 0.5);
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.settings-content h2 {
    font-size: 2em;
    margin-bottom: 25px;
    color: #9b59b6;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.settings-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-label {
    font-size: 1.1em;
    color: #fff;
    flex: 1;
    text-align: left;
    margin-left: 15px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.toggle-switch input:checked + .slider {
    background-color: #9b59b6;
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(26px);
}

.toggle-switch input:focus + .slider {
    box-shadow: 0 0 1px #9b59b6;
}

.help-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1002;
    backdrop-filter: blur(5px);
}

.help-content {
    background: rgba(0, 0, 0, 0.4);
    padding: 40px;
    border-radius: 15px;
    text-align: left;
    border: 2px solid rgba(255, 255, 255, 0.2);
    max-width: 700px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    position: relative;
}

.help-content h2 {
    font-size: 2em;
    margin-bottom: 20px;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    font-weight: bold;
    text-align: center;
}

.btn-close-help {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.3);
    color: white;
    border: 2px solid rgba(231, 76, 60, 0.5);
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.btn-close-help:hover {
    background: rgba(231, 76, 60, 0.5);
    border-color: rgba(231, 76, 60, 0.8);
    transform: scale(1.1);
}

.help-text {
    color: #fff;
    line-height: 1.6;
}

.help-text h3 {
    color: #f39c12;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.3em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.help-text p {
    margin-bottom: 15px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.help-text ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.help-text li {
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.help-text strong {
    color: #f39c12;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .game-container {
        max-width: 100%;
        padding: 0;
    }

    .game-header h1 {
        font-size: 2em;
        margin-bottom: 15px;
    }

    .game-title {
        flex-direction: column;
        gap: 10px;
        font-size: 0.8em;
    }

    .logo-image {
        height: 40px;
    }

    .game-title-text {
        font-size: 1.5em;
    }

    .header-top {
        flex-wrap: wrap;
        gap: 10px;
    }

    .header-buttons-left {
        order: 1;
    }

    .header-top h1 {
        order: 2;
        width: 100%;
        flex: none;
    }

    .btn-restart-header {
        order: 3;
        width: 45px;
        height: 45px;
        font-size: 1.3em;
    }

    .btn-help,
    .btn-settings {
        width: 45px;
        height: 45px;
        font-size: 1.3em;
    }

    .health-container {
        width: 100%;
    }

    .health-bar-container {
        max-width: 100%;
    }

    .health-bar {
        height: 35px;
    }

    .health-text {
        font-size: 0.9em;
    }

    .game-stats {
        flex-direction: column;
        gap: 15px;
        margin-bottom: 20px;
    }

    .stat-item {
        width: 100%;
        padding: 12px 20px;
        text-align: center;
    }

    .stat-label {
        display: block;
        margin-bottom: 5px;
        font-size: 0.9em;
    }

    .stat-value {
        font-size: 1.1em;
    }

    .game-history {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    .history-stat {
        width: 100%;
        justify-content: space-between;
        padding: 10px 15px;
    }

    .discard-pile-container,
    .deck-container,
    .room-container {
        padding: 15px;
        margin-bottom: 15px;
    }

    .section-title,
    .room-title {
        font-size: 1.5em;
        margin-bottom: 15px;
    }

    .room-cards {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 15px;
    }

    .discard-cards,
    .deck-cards {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
        max-height: 300px;
    }

    .room-item {
        min-height: 180px;
    }

    .value-circle {
        width: 35px;
        height: 35px;
        font-size: 0.9em;
        bottom: 8px;
    }

    .room-actions {
        flex-direction: column;
        gap: 15px;
    }

    .btn {
        width: 100%;
        padding: 12px 20px;
        font-size: 1em;
        min-height: 48px; /* Touch target size */
    }

    .message-area {
        min-height: 50px;
        padding: 10px;
    }

    .message {
        font-size: 0.9em;
        padding: 8px 12px;
        margin-bottom: 8px;
    }

    /* Modals and Overlays */
    .game-over-content,
    .settings-content,
    .help-content,
    .choice-content {
        width: 95%;
        max-width: 95%;
        padding: 20px;
        margin: 10px;
        max-height: 90vh;
        overflow-y: auto;
    }

    .game-over-content h2,
    .settings-content h2,
    .help-content h2,
    .choice-content h2 {
        font-size: 1.8em;
    }

    .settings-option {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px;
    }

    .settings-label {
        margin-left: 0;
        font-size: 1em;
    }

    .choice-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .choice-buttons .btn {
        width: 100%;
        min-width: auto;
    }

    .remaining-cards-container {
        max-height: 300px;
        padding: 15px;
    }

    .remaining-cards-container .room-item {
        width: 100px;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    body {
        padding: 5px;
    }

    .game-header h1 {
        font-size: 1.5em;
    }

    .game-title-text {
        font-size: 1.2em;
    }

    .logo-image {
        height: 35px;
    }

    .health-bar {
        height: 30px;
    }

    .health-text {
        font-size: 0.8em;
    }

    .room-cards {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 10px;
    }

    .discard-cards,
    .deck-cards {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
    }

    .room-item {
        min-height: 160px;
    }

    .value-circle {
        width: 30px;
        height: 30px;
        font-size: 0.8em;
    }

    .stat-item {
        padding: 10px 15px;
    }

    .stat-label {
        font-size: 0.85em;
    }

    .stat-value {
        font-size: 1em;
    }

    .btn {
        font-size: 0.9em;
        padding: 10px 15px;
    }

    .game-over-content,
    .settings-content,
    .help-content,
    .choice-content {
        padding: 15px;
    }

    .game-over-content h2,
    .settings-content h2,
    .help-content h2 {
        font-size: 1.5em;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .room-cards {
        grid-template-columns: repeat(4, 1fr);
    }

    .game-header h1 {
        font-size: 1.8em;
        margin-bottom: 10px;
    }

    .health-container {
        margin-bottom: 10px;
    }
}

