* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4285f4;
    --secondary-color: #34a853;
    --background-color: #f5f5f5;
    --card-background: #ffffff;
    --text-color: #333333;
    --text-light: #666666;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --nav-height: 60px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    padding-top: var(--nav-height);
}

/* Navigation Styles */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-weight: 600;
    font-size: 1.2rem;
}

.nav-logo {
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 5px;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: block;
    padding: 8px 16px;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: background-color 0.3s ease;
    font-weight: 500;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Dropdown Menu Styles */
.nav-item.dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
}

.dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.dropdown-toggle.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 180px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    margin-top: 5px;
    z-index: 1001;
    list-style: none;
}

.dropdown-menu.show {
    display: block;
    animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    display: block;
    padding: 10px 20px;
    color: var(--text-color);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background-color: var(--background-color);
}

.dropdown-item.active {
    background-color: var(--primary-color);
    color: white;
}

/* Hamburger Menu */
.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.hamburger {
    width: 25px;
    height: 3px;
    background-color: white;
    border-radius: 3px;
    transition: all 0.3s ease;
    position: relative;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 3px;
    background-color: white;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger::before {
    transform: translateY(-8px);
}

.hamburger::after {
    transform: translateY(8px);
}

/* Mobile Menu Styles */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: var(--nav-height);
        left: -100%;
        width: 100%;
        flex-direction: column;
        background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
        padding: 20px;
        gap: 10px;
        transition: left 0.3s ease;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-link {
        padding: 12px 20px;
        font-size: 1.1rem;
    }

    /* Hamburger Animation */
    .nav-toggle.active .hamburger {
        background-color: transparent;
    }

    .nav-toggle.active .hamburger::before {
        transform: rotate(45deg);
    }

    .nav-toggle.active .hamburger::after {
        transform: rotate(-45deg);
    }
    
    /* Mobile Dropdown */
    .dropdown-menu {
        position: static;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.1);
        margin: 5px 0;
        border-radius: 8px;
    }
    
    .dropdown-item {
        color: white;
        padding: 10px 30px;
    }
    
    .dropdown-item:hover {
        background-color: rgba(255, 255, 255, 0.2);
    }
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Override container width for map viewer */
.container:has(#map-viewer-container) {
    max-width: none;
    padding: 20px;
}

header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    flex: 1;
}

.card {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.card h3 {
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 1.4rem;
}

.card p {
    color: var(--text-light);
    margin-bottom: 10px;
}

.card ul {
    list-style: none;
    padding-left: 0;
}

.card ul li {
    padding: 8px 0;
    color: var(--text-light);
    font-size: 1.05rem;
}

.btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.1s ease;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    background: #3367d6;
    transform: scale(1.02);
}

.btn:active {
    transform: scale(0.98);
}

#click-count {
    margin-top: 15px;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
}

#platform-info {
    font-weight: 600;
    color: var(--secondary-color);
}

footer {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    margin-top: 30px;
}

/* Responsive Design */
@media (max-width: 600px) {
    header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .card {
        padding: 20px;
    }
    
    .container {
        padding: 15px;
    }
}

/* PWA Install Prompt */
.install-prompt {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--card-background);
    padding: 15px 25px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: none;
    z-index: 1000;
}

.install-prompt.show {
    display: block;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Notification Styles */
.notification {
    position: fixed;
    top: calc(var(--nav-height) + 20px);
    right: 20px;
    background: var(--card-background);
    color: var(--text-color);
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2000;
    font-weight: 500;
    border-left: 4px solid var(--primary-color);
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

@media (max-width: 600px) {
    .notification {
        right: 10px;
        left: 10px;
        text-align: center;
    }
}

/* Page Switching Styles */
.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
    scroll-margin-top: var(--nav-height);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 12px;
    color: white;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Technology Stack */
.tech-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tech-item {
    padding: 12px;
    background: var(--background-color);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.tech-item strong {
    color: var(--primary-color);
    margin-right: 8px;
}

/* Settings Page Styles */
.setting-item {
    padding: 15px 0;
    border-bottom: 1px solid var(--background-color);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
}

.setting-input {
    padding: 8px 12px;
    border: 2px solid var(--background-color);
    border-radius: 6px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.setting-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.setting-note {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
}

input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* Responsive adjustments for new content */
@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}

/* Building Cards */
#buildings-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.building-card {
    background: var(--background-color);
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid var(--primary-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.building-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.building-card-action {
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.05), rgba(66, 133, 244, 0.08));
    border-left-color: var(--primary-color);
}

.building-card-action:hover {
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.08), rgba(66, 133, 244, 0.12));
}

.building-card-victory {
    background: linear-gradient(135deg, rgba(52, 168, 83, 0.08), rgba(52, 168, 83, 0.12));
    border-left-color: var(--secondary-color);
}

.building-card-victory:hover {
    background: linear-gradient(135deg, rgba(52, 168, 83, 0.12), rgba(52, 168, 83, 0.16));
}

.building-card-ships-log {
    background: linear-gradient(135deg, rgba(160, 120, 80, 0.08), rgba(160, 120, 80, 0.12));
    border-left-color: #a07850;
}

.building-card-ships-log:hover {
    background: linear-gradient(135deg, rgba(160, 120, 80, 0.12), rgba(160, 120, 80, 0.16));
}

.building-card-lonely-ocean {
    background: linear-gradient(135deg, rgba(128, 90, 160, 0.08), rgba(128, 90, 160, 0.12));
    border-left-color: #805aa0;
}

.building-card-lonely-ocean:hover {
    background: linear-gradient(135deg, rgba(128, 90, 160, 0.12), rgba(128, 90, 160, 0.16));
}

.building-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.building-header h4 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.building-type {
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: capitalize;
}

.building-type-victory {
    background: var(--secondary-color);
}

.building-type-ships-log {
    background: #a07850;
}

.building-type-lonely-ocean {
    background: #805aa0;
}

.building-type-action {
    background: var(--primary-color);
}

.building-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.building-details {
    color: var(--text-light);
    flex: 1;
}

.building-details p {
    margin: 8px 0;
    line-height: 1.6;
}

.building-details strong {
    color: var(--text-color);
    margin-right: 5px;
}

/* Building checkbox for tracking */
.building-checkbox-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 15px;
    border-left: 1px solid #e0e0e0;
}

.building-checkbox-wrapper input[type="checkbox"] {
    width: 28px;
    height: 28px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* Ocean Tokens Grid */
.ocean-tokens-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.ocean-token-card {
    background: var(--background-color);
    border-radius: 12px;
    padding: 15px;
    border: 2px solid #ddd;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.ocean-token-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.token-image {
    width: 100%;
    max-width: 140px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.token-info {
    text-align: center;
    width: 100%;
}

.token-info h4 {
    margin: 0 0 8px 0;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.token-count {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

/* Drawn Tokens Modal */
.drawn-tokens-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.drawn-token-card {
    background: transparent;
    border-radius: 8px;
    padding: 5px;
    border: none;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
}

.drawn-token-card:hover {
    transform: scale(1.08);
    filter: brightness(1.1);
}

.drawn-token-image {
    width: 100%;
    max-width: 150px;
    height: auto;
    border-radius: 8px;
    margin-bottom: 10px;
}

.drawn-token-name {
    margin: 0;
    font-weight: 600;
    color: var(--text-color);
    font-size: 1rem;
}

/* Responsive - single column on mobile for buildings only */
@media (max-width: 768px) {
    #buildings-list {
        grid-template-columns: 1fr;
    }
}

#buildings-list {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 10px;
}

#buildings-list::-webkit-scrollbar {
    width: 8px;
}

#buildings-list::-webkit-scrollbar-track {
    background: var(--background-color);
    border-radius: 4px;
}

#buildings-list::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

#buildings-list::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Setup Form Styles */
.setting-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.setting-hint {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
}

/* Help Button Styles */
.help-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: 2px solid var(--primary-color);
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 8px;
    padding: 0;
    line-height: 1;
}

.help-btn:hover {
    background: white;
    color: var(--primary-color);
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.3);
}

.help-btn:active {
    transform: scale(0.95);
}

/* Removed duplicate - Rail Baron specific styles below */

/* Game Summary Styles */
#game-summary-content {
    background: var(--background-color);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.summary-item {
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    font-weight: 600;
    color: var(--text-color);
}

.summary-value {
    color: var(--primary-color);
    font-weight: 500;
}

/* Multi-select styling */
select[multiple] {
    padding: 10px;
    min-height: 100px;
}

select[multiple] option {
    padding: 8px;
    border-radius: 4px;
    margin: 2px 0;
}

select[multiple] option:checked {
    background: var(--primary-color);
    color: white;
}

/* Radio and Checkbox Groups */
.setting-label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-color);
}

.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-left: 10px;
}

.radio-label,
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.radio-label:hover,
.checkbox-label:hover {
    background-color: var(--background-color);
}

.setting-radio {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

@media (max-width: 600px) {
    .radio-group,
    .checkbox-group {
        margin-left: 0;
    }
}

/* Card Header with Button */
.card-header-with-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 15px;
}

.card-header-with-button h3 {
    margin: 0;
    flex: 1;
}

/* Removed duplicate - Rail Baron specific styles below */

@media (max-width: 600px) {
    .card-header-with-button {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .btn-secondary {
        width: 100%;
    }
}

/* Rail Baron Game Styles */
.rail-baron-container {
    max-width: 900px;
    margin: 0 auto;
    transition: max-width 0.3s ease;
    padding-top: 10px;
}

.rail-baron-container.width-normal {
    max-width: 900px;
}

.rail-baron-container.width-wide {
    max-width: 1400px;
}

.rail-baron-container.width-full {
    max-width: 95%;
}

.rail-baron-container h2 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 15px;
    font-size: 2rem;
}

.rail-baron-container .subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.map-viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
    flex-wrap: wrap;
}

.back-button {
    background: var(--background-color);
    color: var(--text-color);
    border: 2px solid #ddd;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 25px;
}

.back-button:hover {
    background: white;
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateX(-3px);
}

.width-toggle-buttons {
    display: flex;
    gap: 8px;
    background: var(--background-color);
    padding: 4px;
    border-radius: 10px;
    border: 2px solid #ddd;
}

.width-toggle-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.width-toggle-btn:hover {
    background: rgba(66, 133, 244, 0.1);
    color: var(--primary-color);
}

.width-toggle-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.rail-baron-menu {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.rail-baron-menu-btn {
    background: white;
    border: 3px solid #ddd;
    border-radius: 16px;
    padding: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.rail-baron-menu-btn:not(:disabled):hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.05), rgba(52, 168, 83, 0.05));
}

.rail-baron-menu-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.rail-baron-menu-btn .menu-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
}

.rail-baron-menu-btn .menu-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    display: block;
}

.rail-baron-menu-btn .menu-desc {
    font-size: 1rem;
    color: var(--text-light);
    display: block;
}

.rail-baron-menu-btn:disabled .menu-title {
    color: var(--text-light);
}

.roll-section {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
}

.roll-section h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.roll-section > p {
    color: var(--text-light);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.dice-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.manual-input {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    padding: 15px;
    background: var(--background-color);
    border-radius: 8px;
}

.manual-input label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.dice-value-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dice-value-selector label {
    font-size: 0.9rem;
    color: var(--text-light);
}

.dice-value-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 30px;
    background: white;
    border: 3px solid #ddd;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.dice-value-btn:hover {
    border-color: var(--primary-color);
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.dice-value-btn:active {
    transform: translateY(0);
}

.dice-value-display {
    font-size: 2rem;
    color: var(--primary-color);
    font-weight: bold;
}

.parity-selector {
    display: flex;
    gap: 12px;
    width: 100%;
}

.parity-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    padding: 15px 20px;
    border: 3px solid #ddd;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: white;
    font-size: 1.1rem;
    font-weight: 600;
}

.parity-option:hover {
    border-color: var(--primary-color);
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.parity-option input[type="radio"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.parity-option input[type="radio"]:checked + .parity-label {
    color: var(--primary-color);
}

.parity-option:has(input[type="radio"]:checked) {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.1), rgba(52, 168, 83, 0.1));
}

.parity-label {
    font-size: 1.1rem;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.button-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Rail Baron specific button styles */
.rail-baron-container .btn-primary,
.rail-baron-container .btn-secondary {
    flex: 1;
    min-width: 200px;
    padding: 18px 30px;
    font-size: 1.1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    border: none;
    color: white;
}

.rail-baron-container .btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.rail-baron-container .btn-primary:hover {
    background: linear-gradient(135deg, #3367d6, #2d8f47);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.rail-baron-container .btn-primary:active {
    transform: translateY(0);
}

.rail-baron-container .btn-secondary {
    background: linear-gradient(135deg, #5f6368, #80868b);
}

.rail-baron-container .btn-secondary:hover {
    background: linear-gradient(135deg, #4a4d50, #6b7075);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.rail-baron-container .btn-secondary:active {
    transform: translateY(0);
}

.btn-reset {
    background: #ea4335;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.btn-reset:hover {
    background: #c5221f;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-reset:active {
    transform: translateY(0);
}

.result-display {
    margin-top: 20px;
}

.roll-details {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.dice-roll,
.parity-roll {
    background: var(--background-color);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    color: var(--text-color);
    font-size: 1.1rem;
}

.result-box {
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    animation: slideIn 0.3s ease;
}

.result-box.success {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border: 2px solid var(--secondary-color);
}

.result-box strong {
    display: block;
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.result-box p {
    margin: 5px 0;
    color: var(--text-color);
    font-size: 1rem;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.roll-history {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.roll-history::-webkit-scrollbar {
    width: 8px;
}

.roll-history::-webkit-scrollbar-track {
    background: var(--background-color);
    border-radius: 4px;
}

.roll-history::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.roll-history::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

.history-entry {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
    background: var(--background-color);
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
    border-left: 4px solid var(--primary-color);
}

.history-entry:hover {
    transform: translateX(5px);
    background: #e3f2fd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.history-main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.history-details {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.history-detail-label {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.85rem;
}

.history-dice-value {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.1rem;
    padding: 2px 8px;
    background: rgba(66, 133, 244, 0.1);
    border-radius: 4px;
}

.history-parity {
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.history-parity.odd {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffb74d;
}

.history-parity.even {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #81c784;
}

.history-detail-separator {
    color: var(--text-light);
    font-weight: bold;
    margin: 0 4px;
}

/* Railroad Information Page Styles */
.railroad-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 25px;
}

.railroad-selector label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1.1rem;
}

.railroad-dropdown {
    padding: 15px 20px;
    font-size: 1.1rem;
    border: 3px solid #ddd;
    border-radius: 12px;
    background: white;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.railroad-dropdown:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.railroad-dropdown:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

.railroad-info-display {
    animation: fadeIn 0.3s ease;
}

.railroad-detail-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--primary-color);
}

.railroad-detail-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.railroad-detail-header h3 {
    margin: 0;
    font-size: 1.8rem;
    color: white;
}

.railroad-detail-price {
    font-size: 1.3rem;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.railroad-detail-body {
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.railroad-detail-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
    background: var(--background-color);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.railroad-detail-label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.railroad-detail-value {
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.6;
    padding-left: 28px;
}

.railroad-current-status {
    font-weight: 600;
    color: var(--secondary-color);
}

/* Responsive Railroad Info Styles */
@media (max-width: 768px) {
    .railroad-detail-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }
    
    .railroad-detail-header h3 {
        font-size: 1.5rem;
    }
    
    .railroad-detail-price {
        font-size: 1.1rem;
        width: 100%;
        text-align: center;
    }
    
    .railroad-detail-body {
        padding: 20px;
    }
    
    .railroad-detail-label {
        font-size: 1rem;
    }
    
    .railroad-detail-value {
        font-size: 0.95rem;
        padding-left: 24px;
    }
}

@media (max-width: 480px) {
    .railroad-dropdown {
        padding: 12px 16px;
        font-size: 1rem;
    }
    
    .railroad-detail-header h3 {
        font-size: 1.3rem;
    }
    
    .railroad-detail-item {
        padding: 12px;
    }
    
    .railroad-detail-value {
        padding-left: 20px;
    }
}

/* City Railroads List Styles */
.city-railroads-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-left: 28px;
    margin-top: 10px;
}

.city-railroad-badge {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.city-railroad-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
    .city-railroads-list {
        padding-left: 24px;
    }
    
    .city-railroad-badge {
        font-size: 0.85rem;
        padding: 5px 10px;
    }
}

@media (max-width: 480px) {
    .city-railroads-list {
        padding-left: 20px;
    }
    
    .city-railroad-badge {
        font-size: 0.8rem;
        padding: 4px 8px;
    }
}

/* Railroad Abbreviation Styles */
.railroad-abbr {
    font-size: 0.85em;
    opacity: 0.8;
    font-weight: 500;
}

.railroad-abbr-header {
    font-size: 0.7em;
    opacity: 0.9;
    font-weight: 500;
}

.badge-abbr {
    font-size: 0.85em;
    opacity: 0.9;
    font-weight: 400;
}

.history-time {
    font-size: 0.85rem;
    color: var(--text-light);
    min-width: 80px;
}

.history-method {
    font-size: 0.9rem;
    padding: 4px 10px;
    background: white;
    border-radius: 6px;
    font-weight: 600;
}

.history-region {
    font-weight: 600;
    color: var(--primary-color);
}

.history-arrow {
    color: var(--text-light);
    font-weight: bold;
}

.history-destination {
    font-weight: 600;
    color: var(--secondary-color);
}

/* Dice Picker Modal */
.dice-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.dice-modal.show {
    display: flex;
}

.dice-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease;
}

.dice-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    z-index: 10000;
}

.dice-modal-content h3 {
    margin: 0 0 20px 0;
    color: var(--primary-color);
    text-align: center;
    font-size: 1.5rem;
}

.dice-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.dice-grid-btn {
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dice-grid-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.dice-grid-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* City Selector Styles */
.city-selector-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.city-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.city-selector label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1.1rem;
}

.city-select-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 25px;
    background: white;
    border: 3px solid #ddd;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 60px;
}

.city-select-btn:hover {
    border-color: var(--primary-color);
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.city-select-btn:active {
    transform: translateY(0);
}

.city-select-display {
    font-size: 1.2rem;
    color: var(--primary-color);
}

/* City Modal Styles */
.city-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 25px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    z-index: 10000;
}

.city-modal-content h3 {
    margin: 0 0 0 0;
    color: var(--primary-color);
    text-align: center;
    font-size: 1.5rem;
    position: sticky;
    top: -25px;
    background: white;
    padding-top: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--background-color);
    margin-bottom: 20px;
    z-index: 10;
}

.city-regions {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.city-region-group {
    background: var(--background-color);
    padding: 20px;
    border-radius: 12px;
}

.city-region-title {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin: 0 0 15px 0;
    font-weight: bold;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 8px;
}

.city-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.city-grid-btn {
    padding: 15px 10px;
    background: white;
    color: var(--text-color);
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.city-grid-btn:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.1), rgba(52, 168, 83, 0.1));
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.city-grid-btn:active {
    transform: translateY(0);
}

.payoff-detail {
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
}

/* Responsive Rail Baron Styles */
@media (max-width: 768px) {
    .rail-baron-container h2 {
        font-size: 1.5rem;
    }
    
    .rail-baron-container.width-wide,
    .rail-baron-container.width-full {
        max-width: 100%;
    }
    
    .map-viewer-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .width-toggle-buttons {
        width: 100%;
        justify-content: space-between;
    }
    
    .width-toggle-btn {
        flex: 1;
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    
    .rail-baron-menu {
        max-width: 100%;
    }
    
    .rail-baron-menu-btn {
        padding: 25px;
    }
    
    .rail-baron-menu-btn .menu-icon {
        font-size: 2.5rem;
    }
    
    .rail-baron-menu-btn .menu-title {
        font-size: 1.3rem;
    }
    
    .roll-section {
        padding: 20px;
    }
    
    .roll-section h3 {
        font-size: 1.3rem;
    }
    
    .manual-input {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }
    
    .dice-value-selector {
        width: 100%;
    }
    
    .dice-value-btn {
        width: 100%;
    }
    
    .parity-selector {
        width: 100%;
        justify-content: space-around;
    }
    
    .button-group {
        flex-direction: column;
        width: 100%;
    }
    
    .rail-baron-container .btn-primary,
    .rail-baron-container .btn-secondary {
        width: 100%;
        min-width: unset;
    }
    
    .roll-details {
        flex-direction: column;
        gap: 10px;
    }
    
    .history-entry {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .history-time {
        min-width: unset;
    }
    
    .dice-modal-content {
        padding: 20px;
        max-width: 90%;
    }
    
    .dice-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .dice-grid-btn {
        padding: 18px;
        font-size: 1.3rem;
    }
    
    .city-modal-content {
        max-width: 95%;
        padding: 20px;
        max-height: 85vh;
    }
    
    .city-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }
    
    .city-grid-btn {
        padding: 12px 8px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .rail-baron-container h2 {
        font-size: 1.3rem;
    }
    
    .rail-baron-menu-btn {
        padding: 20px;
    }
    
    .rail-baron-menu-btn .menu-icon {
        font-size: 2rem;
    }
    
    .rail-baron-menu-btn .menu-title {
        font-size: 1.2rem;
    }
    
    .roll-section {
        padding: 15px;
    }
    
    .result-box strong {
        font-size: 1.2rem;
    }
    
    .dice-modal-content h3 {
        font-size: 1.2rem;
    }
    
    .dice-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .dice-grid-btn {
        padding: 15px;
        font-size: 1.2rem;
    }
    
    .city-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 6px;
    }
    
    .city-grid-btn {
        padding: 10px 6px;
        font-size: 0.85rem;
    }
    
    .city-region-title {
        font-size: 1.1rem;
    }
}

/* Map Viewer Styles */
.map-viewer-section {
    background: var(--card-background);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.map-canvas-wrapper {
    position: relative;
    background: #f5f5f5;
    border-bottom: 2px solid #e0e0e0;
    overflow: hidden;
    max-height: 70vh;
}

.map-zoom-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 100;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.zoom-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--primary-color);
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.zoom-btn:hover {
    background: #3367d6;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.zoom-btn:active {
    transform: scale(0.95);
}

.zoom-level {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
    padding: 5px 0;
    background: var(--background-color);
    border-radius: 6px;
}

.map-loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.loading-spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.map-canvas {
    position: relative;
    display: block;
    transition: transform 0.1s ease-out;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.map-base-image {
    display: block;
    width: 100%;
    height: auto;
    position: relative;
    pointer-events: none;
}

.map-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.85;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.map-overlay.hidden {
    opacity: 0;
}

.map-controls-panel {
    padding: 25px;
    background: #fafafa;
}

.controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
    flex-wrap: wrap;
}

.controls-header h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.3rem;
}

.toggle-all-buttons {
    display: flex;
    gap: 10px;
}

.toggle-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-btn.show-all {
    background: var(--secondary-color);
    color: white;
}

.toggle-btn.show-all:hover {
    background: #2d8f47;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.toggle-btn.hide-all {
    background: #ea4335;
    color: white;
}

.toggle-btn.hide-all:hover {
    background: #c5221f;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.railroad-toggles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.railroad-toggles::-webkit-scrollbar {
    width: 8px;
}

.railroad-toggles::-webkit-scrollbar-track {
    background: var(--background-color);
    border-radius: 4px;
}

.railroad-toggles::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.railroad-toggles::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

.railroad-toggle-item {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.railroad-toggle-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.railroad-toggle-item:has(.railroad-checkbox:checked) {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.05), rgba(52, 168, 83, 0.05));
}

.railroad-checkbox {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: var(--primary-color);
    margin-right: 12px;
    vertical-align: middle;
}

.railroad-label {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    flex: 1;
}

.railroad-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.railroad-price {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Responsive Map Viewer Styles */
@media (max-width: 768px) {
    .map-canvas-wrapper {
        max-height: 50vh;
    }
    
    .map-zoom-controls {
        top: 10px;
        right: 10px;
        padding: 8px;
        gap: 6px;
    }
    
    .zoom-btn {
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
    }
    
    .zoom-level {
        font-size: 0.8rem;
        padding: 4px 0;
    }
    
    .map-controls-panel {
        padding: 20px;
    }
    
    .controls-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .toggle-all-buttons {
        width: 100%;
    }
    
    .toggle-btn {
        flex: 1;
    }
    
    .railroad-toggles {
        grid-template-columns: 1fr;
        max-height: 300px;
    }
}

@media (max-width: 480px) {
    .map-controls-panel {
        padding: 15px;
    }
    
    .controls-header h3 {
        font-size: 1.1rem;
    }
    
    .toggle-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .railroad-toggle-item {
        padding: 12px;
    }
    
    .railroad-name {
        font-size: 0.9rem;
    }
    
    .railroad-price {
        font-size: 0.8rem;
    }
}

/* Building Select Button Styles (for Score Calculator) */
.building-select-btn {
    background: white;
    border: 3px solid #ddd;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    display: block;
    width: 100%;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.building-select-btn:hover {
    border-color: var(--primary-color);
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.building-select-btn.selected {
    border-color: var(--secondary-color);
    background: linear-gradient(135deg, rgba(52, 168, 83, 0.1), rgba(52, 168, 83, 0.15));
    box-shadow: 0 4px 12px rgba(52, 168, 83, 0.2);
}

.building-select-btn.selected:hover {
    background: linear-gradient(135deg, rgba(52, 168, 83, 0.15), rgba(52, 168, 83, 0.2));
}

/* Dice Picker Grid Styles */
.dice-picker-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-top: 20px;
}

/* Whale Picker Grid Styles (New Bedford specific) */
.whale-picker-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

/* Money Picker Grid Styles (New Bedford specific - narrower for $ symbols) */
.money-picker-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.dice-picker-btn {
    padding: 15px;
    background: white;
    color: var(--text-color);
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.dice-picker-btn:hover {
    border-color: var(--primary-color);
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.dice-picker-btn.selected {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

.dice-picker-btn:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .dice-picker-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }
    
    .whale-picker-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .money-picker-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .dice-picker-btn {
        padding: 12px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .dice-picker-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }
    
    .whale-picker-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    
    .money-picker-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .dice-picker-btn {
        padding: 10px;
        font-size: 1rem;
    }
}

/* Catan Container */
.catan-container {
    max-width: 900px;
    margin: 0 auto;
    padding-top: 10px;
    container-type: inline-size;
    container-name: catan-board;
}

.catan-container h2 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 15px;
    font-size: 2rem;
}

/* Catan Map Generator Styles */
.catan-map {
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    background: linear-gradient(135deg, #e3f2fd 0%, #f1f8e9 100%);
    border-radius: 12px;
    overflow-x: auto;
}

.hex-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
}

.hex-row {
    display: flex;
    gap: 0;
    justify-content: flex-start;
    margin-top: calc(-16.67cqw * 0.287);
}

.hex-row:first-child {
    margin-top: 0;
}

/* Honeycomb pattern - alternating rows offset by half hex width (BASE GAME ONLY) */
.hex-grid:not(.hex-grid-56) .hex-row:nth-child(even) {
    margin-left: 8.335cqw;
}

.hex-grid:not(.hex-grid-56) .hex-row:nth-child(odd) {
    margin-left: 0;
}

/* First and last rows (3 tiles) need extra offset to center the hexagonal shape (BASE GAME ONLY) */
.hex-grid:not(.hex-grid-56) .hex-row:nth-child(1),
.hex-grid:not(.hex-grid-56) .hex-row:nth-child(5) {
    margin-left: 16.67cqw;
}

.hex {
    width: 16.67cqw;
    height: calc(16.67cqw * 1.15);
    position: relative;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    margin-left: -0.15cqw;
}

.hex:first-child {
    margin-left: 0;
}

.hex:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.hex-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px;
    text-align: center;
    width: 100%;
    height: 100%;
}

.terrain-name {
    font-size: 2cqw;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(0, 0, 0, 0.8);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.number-token {
    background: #f5f5dc;
    border: 3px solid #8b7355;
    border-radius: 50%;
    width: 8cqw;
    height: 8cqw;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.number-token.number-red {
    border-color: #d32f2f;
}

.number-token.number-red .number-value {
    color: #d32f2f;
}

.number-value {
    font-size: 2.5cqw;
    font-weight: bold;
    color: #333;
    line-height: 1;
}

.number-pips {
    font-size: 0.9cqw;
    color: #666;
    letter-spacing: 1px;
    line-height: 1;
    margin-top: 2px;
}

.robber-icon {
    font-size: 4cqw;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Terrain Colors */
.terrain-forest {
    background: linear-gradient(135deg, #2e7d32 0%, #43a047 100%);
}

.terrain-pasture {
    background: linear-gradient(135deg, #7cb342 0%, #9ccc65 100%);
}

.terrain-grain {
    background: linear-gradient(135deg, #f9a825 0%, #fdd835 100%);
}

.terrain-hills {
    background: linear-gradient(135deg, #d84315 0%, #ff5722 100%);
}

.terrain-mountains {
    background: linear-gradient(135deg, #616161 0%, #9e9e9e 100%);
}

.terrain-desert {
    background: linear-gradient(135deg, #f4a460 0%, #daa520 100%);
}

/* Responsive Catan Map */
@media (max-width: 480px) {
    .catan-map {
        padding: 10px;
        overflow-x: auto;
    }
    
    .hex {
        width: 70px;
        height: 80px;
        margin-left: -0.5px;
    }
    
    .hex:first-child {
        margin-left: 0;
    }
    
    .hex-row {
        gap: 0;
        margin-top: -20px;
    }
    
    .hex-row:first-child {
        margin-top: 0;
    }
    
    .hex-grid:not(.hex-grid-56) .hex-row:nth-child(even) {
        margin-left: 35px;
    }
    
    .hex-grid:not(.hex-grid-56) .hex-row:nth-child(odd) {
        margin-left: 0;
    }
    
    .hex-grid:not(.hex-grid-56) .hex-row:nth-child(1),
    .hex-grid:not(.hex-grid-56) .hex-row:nth-child(5) {
        margin-left: 70px;
    }
    
    .terrain-name {
        font-size: 0.5rem;
        letter-spacing: 0.3px;
    }
    
    .number-token {
        width: 28px;
        height: 28px;
        border-width: 2px;
    }
    
    .number-value {
        font-size: 0.9rem;
    }
    
    .number-pips {
        font-size: 0.35rem;
        letter-spacing: 0.5px;
    }
    
    .robber-icon {
        font-size: 1.5rem;
    }
}

/* Expansion Checkbox Styles */
.expansion-checkbox-label {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 15px 25px;
        background: linear-gradient(135deg, rgba(66, 133, 244, 0.1), rgba(52, 168, 83, 0.1));
        border: 3px solid #ddd;
        border-radius: 12px;
        cursor: pointer;
        transition: all 0.3s ease;
        font-weight: 600;
        font-size: 1.1rem;
        color: var(--text-color);
    }
    
    .expansion-checkbox-label:hover {
        border-color: var(--primary-color);
        background: linear-gradient(135deg, rgba(66, 133, 244, 0.15), rgba(52, 168, 83, 0.15));
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }
    
    .expansion-checkbox {
        width: 24px;
        height: 24px;
        cursor: pointer;
        accent-color: var(--primary-color);
    }
    
    .expansion-checkbox-text {
        font-size: 1.1rem;
        color: var(--text-color);
    }
    
    .expansion-checkbox-label:has(.expansion-checkbox:checked) {
        border-color: var(--secondary-color);
        background: linear-gradient(135deg, rgba(52, 168, 83, 0.2), rgba(66, 133, 244, 0.2));
    }
    
    /* 5-6 Player Board Styles */
    .hex-grid-56 {
        transform: scale(1);
        transform-origin: top center;
    }
    
    .hex-56 {
        width: 14.29cqw;
        height: calc(14.29cqw * 1.14);
    }
    
    /* 5-6 player vertical spacing - less overlap than base game */
    .hex-grid-56 .hex-row {
        margin-top: calc(-14.29cqw * 0.29);
    }
    
    .hex-grid-56 .hex-row:first-child {
        margin-top: 0;
    }
    
    /* 5-6 player pattern: 3-4-5-6-5-4-3 - symmetrical hexagon */
    /* Each row explicitly positioned - NO base even/odd rules */
    .hex-grid-56 .hex-row:nth-child(1) {
        margin-left: 21.435cqw !important;  /* Row 1: 3 tiles (14.29cqw * 1.5) */
    }
    
    .hex-grid-56 .hex-row:nth-child(2) {
        margin-left: 14.29cqw !important;   /* Row 2: 4 tiles (14.29cqw * 1) */
    }
    
    .hex-grid-56 .hex-row:nth-child(3) {
        margin-left: 7.145cqw !important;   /* Row 3: 5 tiles (14.29cqw * 0.5) */
    }
    
    .hex-grid-56 .hex-row:nth-child(4) {
        margin-left: 0 !important;          /* Row 4: 6 tiles - widest, centered */
    }
    
    .hex-grid-56 .hex-row:nth-child(5) {
        margin-left: 7.145cqw !important;   /* Row 5: 5 tiles */
    }
    
    .hex-grid-56 .hex-row:nth-child(6) {
        margin-left: 14.29cqw !important;   /* Row 6: 4 tiles */
    }
    
    .hex-grid-56 .hex-row:nth-child(7) {
        margin-left: 21.435cqw !important;  /* Row 7: 3 tiles */
    }
    
    .hex-56 .terrain-name {
        font-size: 1.286cqw;  /* 1.5cqw * 0.857 */
    }
    
    .hex-56 .number-token {
        width: 6.856cqw;      /* 8cqw * 0.857 */
        height: 6.856cqw;
        border-width: 2px;
    }
    
    .hex-56 .number-value {
        font-size: 2.143cqw;  /* 2.5cqw * 0.857 */
    }
    
    .hex-56 .number-pips {
        font-size: 0.771cqw;  /* 0.9cqw * 0.857 */
    }
    
    .hex-56 .robber-icon {
        font-size: 3.428cqw;  /* 4cqw * 0.857 */
    }
    
    /* Catan Resource Tracker Styles */
    .catan-resource-tracker {
        max-width: 600px;
        margin: 0 auto;
        padding: 20px;
        background: var(--card-background);
        border-radius: var(--border-radius);
        box-shadow: var(--shadow);
    }
    
    .catan-resource-tracker h2 {
        color: var(--primary-color);
        text-align: center;
        margin-bottom: 20px;
    }
    
    .resource-input-section {
        background: var(--background-color);
        border-radius: 8px;
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .resource-input-section .input-row {
        display: flex;
        flex-direction: column;
        margin-bottom: 15px;
    }
    
    .resource-input-section .input-row label {
        margin-bottom: 8px;
        color: var(--text-light);
        font-weight: 500;
    }
    
    .resource-input-section .input-row input,
    .resource-input-section .input-row select {
        padding: 10px;
        border: 2px solid #ddd;
        border-radius: 8px;
        font-size: 1rem;
    }
    
    #add-resource-btn {
        width: 100%;
        padding: 12px;
        margin-top: 10px;
    }
    
    .resource-list-section {
        background: var(--background-color);
        border-radius: 8px;
        padding: 15px;
    }
    
    .resource-list {
        list-style-type: none;
        padding: 0;
        max-height: 300px;
        overflow-y: auto;
    }
    
    .resource-list li {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: white;
        margin-bottom: 10px;
        padding: 12px;
        border-radius: 8px;
        border-left: 4px solid var(--primary-color);
        transition: all 0.2s ease;
    }
    
    .resource-list li:hover {
        transform: translateX(5px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .resource-details {
        flex-grow: 1;
        margin-right: 10px;
        color: var(--text-color);
    }
    
    .remove-resource-btn {
        background: none;
        border: none;
        cursor: pointer;
        font-size: 18px;
        color: #d32f2f;
        transition: color 0.2s ease;
    }
    
    .remove-resource-btn:hover {
        color: #b71c1c;
    }
    
    #reset-resources-btn {
        width: 100%;
        margin-top: 15px;
        background: #ea4335;
        color: white;
    }
    
    #reset-resources-btn:hover {
        background: #c5221f;
    }
    
    @media (max-width: 600px) {
        .catan-resource-tracker {
            padding: 15px;
            width: 95%;
        }
    }

/* Catan Menu Styles */
.catan-menu {
   display: flex;
   flex-direction: column;
   gap: 20px;
   max-width: 600px;
   margin: 0 auto;
}

.catan-menu-btn {
   background: white;
   border: 3px solid #ddd;
   border-radius: 16px;
   padding: 30px;
   cursor: pointer;
   transition: all 0.3s ease;
   text-align: left;
   display: flex;
   flex-direction: column;
   gap: 10px;
   box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.catan-menu-btn:not(:disabled):hover {
   border-color: var(--secondary-color);
   transform: translateY(-5px);
   box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
   background: linear-gradient(135deg, rgba(66, 133, 244, 0.05), rgba(52, 168, 83, 0.05));
}

.catan-menu-btn:disabled {
   opacity: 0.5;
   cursor: not-allowed;
}

.catan-menu-btn .menu-icon {
   font-size: 3rem;
   display: block;
   margin-bottom: 10px;
}

.catan-menu-btn .menu-title {
   font-size: 1.5rem;
   font-weight: bold;
   color: var(--secondary-color);
   display: block;
}

.catan-menu-btn .menu-desc {
   font-size: 1rem;
   color: var(--text-light);
   display: block;
}

/* Catan Section */
.catan-section {
   background: var(--card-background);
   border-radius: var(--border-radius);
   padding: 25px;
   margin-bottom: 25px;
   box-shadow: var(--shadow);
}

.catan-section h3 {
   color: var(--secondary-color);
   margin-bottom: 10px;
   font-size: 1.5rem;
}

/* Catan Modal Styles */
.catan-modal {
   position: fixed;
   top: 0;
   left: 0;
   right: 0;
   bottom: 0;
   z-index: 9999;
   display: none;
   align-items: center;
   justify-content: center;
   padding: 20px;
}

.catan-modal.show {
   display: flex;
}

.catan-modal-overlay {
   position: absolute;
   top: 0;
   left: 0;
   right: 0;
   bottom: 0;
   background: rgba(0, 0, 0, 0.5);
   animation: fadeIn 0.2s ease;
}

.catan-modal-content {
   position: relative;
   background: white;
   border-radius: 16px;
   padding: 25px;
   width: 90%;
   max-width: 450px;
   box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
   animation: slideUp 0.3s ease;
   z-index: 10000;
   max-height: 80vh;
   overflow-y: auto;
   overflow-x: hidden;
}

.catan-modal-content h3 {
   margin: 0 0 15px 0;
   color: var(--secondary-color);
   text-align: center;
   font-size: 1.5rem;
}

/* Catan Input Sections */
.catan-input-section {
   display: flex;
   flex-direction: column;
   gap: 8px;
   margin-bottom: 15px;
}

.catan-input-section label {
   font-size: 1rem;
   color: var(--text-light);
   font-weight: 500;
}

/* Catan Dice Grid */
.catan-dice-grid {
   display: grid;
   grid-template-columns: repeat(4, 1fr);
   gap: 8px;
}

.catan-resource-grid {
   display: grid;
   grid-template-columns: repeat(3, 1fr);
   gap: 8px;
}

.catan-dice-btn,
.catan-resource-btn {
   padding: 12px 8px;
   background: white;
   color: var(--text-color);
   border: 2px solid #ddd;
   border-radius: 10px;
   font-size: 1.1rem;
   font-weight: 600;
   cursor: pointer;
   transition: all 0.2s ease;
   box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
   text-align: center;
}

.catan-dice-btn:hover,
.catan-resource-btn:hover {
   border-color: var(--secondary-color);
   background: #f8f9fa;
   transform: translateY(-2px);
   box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.catan-dice-btn.selected,
.catan-resource-btn.selected {
   background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
   color: white;
   border-color: var(--secondary-color);
   box-shadow: 0 4px 12px rgba(52, 168, 83, 0.3);
}

/* Catan Resource Roll Display Styles */
.resource-roll-display {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 5px;
}

.resource-roll-display::-webkit-scrollbar {
    width: 8px;
}

.resource-roll-display::-webkit-scrollbar-track {
    background: var(--background-color);
    border-radius: 4px;
}

.resource-roll-display::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

.no-resources {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-light);
    font-style: italic;
    background: var(--background-color);
    border-radius: 10px;
}

.dice-roll-group {
    background: var(--background-color);
    border-radius: 12px;
    overflow: visible;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
    display: flex;
    margin-bottom: 20px;
}

.dice-roll-group:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dice-roll-header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: white;
    padding: 20px;
    min-width: 60px;
    width: 60px;
}

.dice-roll-number {
    font-size: 2.5rem;
    font-weight: bold;
    line-height: 1;
}

.dice-roll-pip {
    font-size: 1.4rem;
    opacity: 0.8;
}

.resource-items {
    padding: 15px;
    flex: 1;
    min-height: 100%;
    height: auto;
    overflow: hidden;
}

.resource-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    padding: 10px;
    height: auto;
    min-height: 100%;
}

.resource-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
    padding: 8px;
    border-radius: 10px;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    width: 100%;
}

.resource-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.resource-item.city {
    border-top: 4px solid #f9a825;
    background: linear-gradient(to bottom, rgba(249, 168, 37, 0.1), transparent 15%);
}

.resource-item.settlement {
    border-top: 4px solid var(--primary-color);
}

.resource-images {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
    margin-bottom: 8px;
    padding: 5px;
}

.resource-image {
    width: 100%;
    height: auto;
    max-width: 110px;
    max-height: 110px;
    object-fit: contain;
    border-radius: 8px;
}

.resource-image-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    margin-bottom: 6px;
    padding: 4px;
    width: 100%;
    height: auto;
}

.resource-multiplier {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: #f9a825;
    color: white;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.9rem;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

@media (max-width: 480px) {
    .resource-multiplier {
        position: absolute;
        top: 5px;
        right: 5px;
    }
    
    .resource-image-wrapper {
        position: relative;
    }
}

.upgrade-resource-btn {
    position: absolute;
    bottom: 5px;
    left: 5px;
    background: white;
    border: 2px solid #4caf50;
    border-radius: 50%;
    width: calc(5vw + 18px);
    max-width: 36px;
    height: calc(5vw + 18px);
    max-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: calc(2.5vw + 12px);
    max-font-size: 24px;
    font-weight: bold;
    color: #4caf50;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 5;
}

.upgrade-resource-btn:hover {
    background: #4caf50;
    color: white;
    transform: scale(1.1);
}

/* Responsive scaling for mobile */
@media (max-width: 768px) {
    .resource-image {
        width: 100%;
        max-width: 100px;
        max-height: 100px;
    }
    
    .resource-items-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .resource-image {
        width: 100%;
        height: auto;
        max-width: 90px;
        max-height: 90px;
    }
    
    .resource-items-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }
    
    .resource-item {
        padding: 6px;
    }
    
    .resource-multiplier {
        font-size: 0.75rem;
        padding: 2px 5px;
    }
}

.resource-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9rem;
    text-align: center;
    margin-top: auto;
}

.remove-resource-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    background: white;
    border: 2px solid #d32f2f;
    border-radius: 50%;
    width: calc(4vw + 16px);
    max-width: 32px;
    height: calc(4vw + 16px);
    max-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: calc(2vw + 10px);
    max-font-size: 18px;
    color: #d32f2f;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 5;
}

.remove-resource-btn:hover {
    background: #d32f2f;
    color: white;
    transform: scale(1.1);
}

.catan-button-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

.catan-button-group .btn {
    width: 80%;
    max-width: 300px;
    padding: 15px;
}

@media (max-width: 600px) {
    .dice-roll-header {
        padding: 10px 15px;
    }
    
    .dice-roll-number {
        font-size: 1.5rem;
    }
    
    .dice-roll-pip {
        font-size: 1rem;
    }
    
    .resource-items-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 10px;
    }
    
    .resource-item {
        padding: 6px;
    }
    
    .resource-image {
        width: 100%;
        max-width: 100px;
        max-height: 100px;
    }
    
    .resource-name {
        font-size: 0.8rem;
    }
    
    .catan-button-group {
        flex-direction: column;
        gap: 10px;
    }
}

/* Catan Settlement Selection */
.catan-selector {
   display: flex;
   flex-direction: column;
   gap: 10px;
   width: 100%;
}

.catan-option {
   display: flex;
   align-items: center;
   gap: 10px;
   padding: 12px 15px;
   border: 2px solid #ddd;
   border-radius: 10px;
   background: white;
   cursor: pointer;
   transition: all 0.3s ease;
}

.catan-option:hover {
   border-color: var(--secondary-color);
   background: #f8f9fa;
   transform: translateY(-2px);
   box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.catan-option input[type="radio"] {
   width: 20px;
   height: 20px;
   cursor: pointer;
   accent-color: var(--secondary-color);
}

.catan-option:has(input[type="radio"]:checked) {
   border-color: var(--secondary-color);
   background: linear-gradient(135deg, rgba(52, 168, 83, 0.1), rgba(66, 133, 244, 0.1));
}

.option-label {
   font-size: 1rem;
   color: var(--text-color);
}

/* Responsive Styles for Catan UI */
@media (max-width: 768px) {
   .catan-menu-btn {
       padding: 25px;
   }
   
   .catan-menu-btn .menu-icon {
       font-size: 2.5rem;
   }
   
   .catan-menu-btn .menu-title {
       font-size: 1.3rem;
   }
   
   .catan-section {
       padding: 20px;
   }
   
   .catan-section h3 {
       font-size: 1.3rem;
   }
   
   .catan-modal-content {
       padding: 20px;
   }
   
   .catan-dice-grid {
       grid-template-columns: repeat(3, 1fr);
   }
}

@media (max-width: 480px) {
   .catan-menu-btn {
       padding: 20px;
   }
   
   .catan-menu-btn .menu-icon {
       font-size: 2rem;
   }
   
   .catan-menu-btn .menu-title {
       font-size: 1.2rem;
   }
   
   
   .catan-section {
       padding: 15px;
   }
   
   .catan-dice-grid {
       grid-template-columns: repeat(3, 1fr);
       gap: 6px;
   }
   
   .catan-resource-grid {
       grid-template-columns: repeat(2, 1fr);
       gap: 6px;
   }
   
   .catan-dice-btn,
   .catan-resource-btn {
       padding: 10px 6px;
       font-size: 0.9rem;
   }
}

/* Catan Resource Multiplier Picker Grid - Catan-specific version of whale picker */
.catan-multiplier-picker-grid {
   display: grid;
   grid-template-columns: repeat(5, 1fr);
   gap: 10px;
}

.catan-multiplier-picker-btn {
   padding: 15px;
   background: white;
   color: var(--text-color);
   border: 2px solid #ddd;
   border-radius: 10px;
   font-size: 1.2rem;
   font-weight: 600;
   cursor: pointer;
   transition: all 0.2s ease;
   box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.catan-multiplier-picker-btn:hover {
   border-color: var(--secondary-color);
   background: #f8f9fa;
   transform: translateY(-2px);
   box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.catan-multiplier-picker-btn.selected {
   background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
   color: white;
   border-color: var(--secondary-color);
   box-shadow: 0 4px 12px rgba(52, 168, 83, 0.3);
}

.catan-multiplier-picker-btn:active {
   transform: translateY(0);
}

@media (max-width: 768px) {
   .catan-multiplier-picker-grid {
       grid-template-columns: repeat(4, 1fr);
       gap: 8px;
   }
   
   .catan-multiplier-picker-btn {
       padding: 12px;
       font-size: 1.1rem;
   }
}

@media (max-width: 480px) {
   .catan-multiplier-picker-grid {
       grid-template-columns: repeat(3, 1fr);
       gap: 6px;
   }
   
   .catan-multiplier-picker-btn {
       padding: 10px;
       font-size: 1rem;
   }
}