/* SOLATRO - iPhone-like Mobile App Styles */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Ballatro-inspired Color Palette */
    --primary-color: #D4AF37;
    --primary-dark: #B8941F;
    --secondary-color: #8B4B9C;
    --success-color: #50C878;
    --warning-color: #FF6B35;
    --danger-color: #E74C3C;
    --background-color: #0F0A1A;
    --surface-color: #1A1428;
    --card-color: #2A1F3D;
    --text-primary: #F5E6D3;
    --text-secondary: #A08B7A;
    --border-color: #4A3B5C;
    --accent-color: #E94560;
    
    /* Typography */
    --font-system: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* Spacing - More mobile-friendly, tighter spacing */
    --spacing-xs: 3px;
    --spacing-sm: 7px;
    --spacing-md: 10px;
    --spacing-lg: 14px;
    --spacing-xl: 18px;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.4);
    
    /* Status bar height for iPhone */
    --status-bar-height: 44px;
    --safe-area-top: env(safe-area-inset-top, 44px);
    --safe-area-bottom: env(safe-area-inset-bottom, 34px);
}

body {
    font-family: var(--font-system);
    background: linear-gradient(135deg, var(--background-color) 0%, #1A0F2E 50%, var(--background-color) 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

/* App Container */
.app-container {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-top: var(--safe-area-top);
    padding-bottom: var(--safe-area-bottom);
}

/* Status Bar Spacer */
.status-bar-spacer {
    height: var(--status-bar-height);
    background: linear-gradient(180deg, var(--background-color) 0%, transparent 100%);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

/* Header */
.app-header {
    background: rgba(15, 10, 26, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 2px solid var(--primary-color);
    padding: var(--spacing-sm);
    position: sticky;
    top: var(--safe-area-top);
    z-index: 50;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(212, 175, 55, 0.1);
}

.app-header h1 {
    font-size: 20px;
    font-weight: var(--font-weight-bold);
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, #FFD700 50%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2px;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
    letter-spacing: 1px;
}

.game-credit {
    font-size: 12px;
    text-align: center;
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
    margin-bottom: var(--spacing-sm);
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: underline;
    text-decoration-color: transparent;
    font-family: var(--font-system);
}

.game-credit.subtitle {
    display: block;
    width: 100%;
    text-align: center;
    margin: 0 auto;
    margin-top: var(--spacing-xs);
}

.game-credit:hover {
    color: var(--primary-color);
    text-decoration-color: var(--primary-color);
    transform: scale(1.05);
}

.header-stats {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: var(--spacing-sm);
    padding-bottom: var(--safe-area-bottom);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    max-width: 768px;
    margin: 0 auto;
    width: 100%;
}

/* View Content - consistent padding for all content areas */
.view-content {
    padding: var(--spacing-sm);
    max-width: 768px;
    margin: 0 auto;
    width: 100%;
}

/* Card Styles */
.card {
    background: linear-gradient(145deg, var(--card-color) 0%, #3A2F4A 100%);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(212, 175, 55, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.05) 0%, transparent 50%);
    border-radius: var(--radius-lg);
    pointer-events: none;
}

.card h2 {
    font-size: 17px;
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

/* Game Status Grid */
.status-row {
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
    justify-content: space-between;
}

.status-item {
    text-align: center;
    padding: 2px var(--spacing-xs);
    background: linear-gradient(145deg, var(--surface-color) 0%, #241837 100%);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 2px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    flex: 1;
}

.status-item::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.3), transparent);
    border-radius: var(--radius-md);
}

.status-label {
    display: block;
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1px;
    font-weight: var(--font-weight-medium);
}

.status-value {
    display: block;
    font-size: 16px;
    font-weight: var(--font-weight-bold);
    background: linear-gradient(135deg, var(--primary-color) 0%, #FFD700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.status-item.target-reached {
    border: 2px solid var(--success-color);
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.4);
    border-radius: var(--radius-md);
    padding: var(--spacing-xs);
}

.status-item.target-reached .status-value {
    color: var(--success-color);
    font-weight: 600;
}

/* Shield Used Score Status */
.status-item.shield-used-score {
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
    border-radius: var(--radius-md);
    padding: var(--spacing-xs);
}

.status-item.shield-used-score .status-value {
    color: var(--primary-color);
    font-weight: 600;
}

/* Game Over Score Status */
.status-item.game-over-score {
    border: 2px solid var(--danger-color);
    box-shadow: 0 0 15px rgba(244, 67, 54, 0.4);
    border-radius: var(--radius-md);
    padding: var(--spacing-xs);
}

.status-item.game-over-score .status-value {
    color: var(--danger-color);
    font-weight: 600;
}

/* Discard Status Item */
.discard-status.disabled {
    opacity: 0.5;
}

.discard-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
}

.discard-icon {
    font-size: 16px;
    color: var(--danger-color);
}

/* Scoring Header */
.scoring-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.scoring-header h2 {
    margin: 0;
}

.discard-button {
    display: flex;
    align-items: center;
    background: transparent;
    border: 2px solid #FFD700;
    border-radius: var(--radius-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    color: #FFD700;
    font-weight: var(--font-weight-medium);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: none;
}

.discard-button:hover {
    background: rgba(255, 215, 0, 0.1);
    transform: scale(1.05);
}

.discard-button:active {
    transform: translateY(0);
}

.discard-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.discard-count {
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    font-size: 12px;
    font-weight: var(--font-weight-bold);
}

/* Hand Selector */
.hand-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-xs);
    margin-top: var(--spacing-sm);
}

@media (max-width: 380px) {
    .hand-grid {
        grid-template-columns: 1fr;
    }
}

.hand-item {
    background: var(--surface-color);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: var(--spacing-sm);
    transition: all 0.2s ease;
    cursor: pointer;
}

.hand-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.1);
}

.hand-item.selected {
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
    background: rgba(212, 175, 55, 0.05);
}

.hand-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(100%);
}

.hand-item.disabled:hover {
    transform: none;
    border-color: var(--border-color);
    box-shadow: none;
}

.hand-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.hand-header h3 {
    font-size: 14px;
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.hand-points {
    font-size: 12px;
    font-weight: var(--font-weight-bold);
    background: linear-gradient(135deg, var(--success-color) 0%, #66D17A 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hand-example {
    font-size: 13px;
    font-weight: var(--font-weight-medium);
    color: var(--primary-color);
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    letter-spacing: 0.5px;
    text-align: center;
    line-height: 1.2;
}

/* Complete Round Section */
.complete-round-section {
    text-align: center;
    border: 2px solid var(--success-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    background: var(--card-color);
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.2);
}

/* Shield Used Complete Round Section */
.complete-round-section.shield-used {
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
}

/* Game Over Complete Round Section */
.complete-round-section.game-over {
    border: 2px solid var(--danger-color);
    box-shadow: 0 0 15px rgba(244, 67, 54, 0.2);
}

.complete-round-section .result-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
}

.complete-round-section .result-icon {
    font-size: 2.5em;
    margin-bottom: 0;
}

.complete-round-section h2 {
    color: var(--success-color);
    margin-bottom: 0;
    font-size: 1.4em;
}

.complete-round-section h2.shield-used {
    color: var(--primary-color);
}

.complete-round-section p {
    display: none; /* Hide all gray text in round complete container */
}

.complete-round-section .result-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-sm);
    width: 100%;
    margin-bottom: 0;
}

.complete-round-section .result-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
    background: var(--surface-color);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.complete-round-section .stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.complete-round-section .stat-value {
    font-size: 1.2em;
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
}

.complete-round-section .stat-value.bonus-points {
    color: var(--primary-color);
}

/* Milestone Display */
.achievement-unlock {
    margin: var(--spacing-md) 0;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--primary-color);
    background: transparent;
    border-radius: var(--radius-sm);
    text-align: center;
    animation: achievementGlow 2s ease-in-out infinite alternate;
}

.achievement-unlock .achievement-name {
    color: var(--primary-color);
    font-size: 0.9em;
    font-weight: var(--font-weight-semibold);
    margin: 0;
}

@keyframes achievementGlow {
    0% { box-shadow: 0 0 10px rgba(212, 175, 55, 0.5); }
    100% { box-shadow: 0 0 20px rgba(212, 175, 55, 0.8); }
}

.center-button {
    display: flex;
    justify-content: center;
}

/* After Turn View */
.after-turn-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.round-results-card {
    text-align: center;
}

.result-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
}

.round-results-card h2 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.result-stat {
    text-align: center;
    padding: var(--spacing-md);
    background: var(--surface-color);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-xs);
    font-weight: var(--font-weight-medium);
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
}

.stat-value.bonus-points {
    background: linear-gradient(135deg, var(--primary-color) 0%, #FFD700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shop-card {
    border: 2px solid var(--border-color);
}

.shop-card.purchases-available {
    border: 2px solid var(--primary-color);
}

/* Items section when in shop mode with purchases available */
.items-section.purchases-available {
    border: 2px solid var(--primary-color);
}

.shop-card h2 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: var(--spacing-sm);
}

.shop-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    font-style: italic;
}

.shop-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
}

.next-round-container {
    margin-top: var(--spacing-md);
    text-align: center;
}

.next-round-section {
    margin-top: var(--spacing-sm);
    text-align: center;
    padding: var(--spacing-sm);
}

.large-button {
    font-size: 20px;
    padding: var(--spacing-lg) var(--spacing-xl);
    min-height: 60px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

/* Buttons */
.primary-button,
.secondary-button,
.danger-button {
    border: none;
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 16px;
    font-weight: var(--font-weight-semibold);
    font-family: var(--font-system);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    min-height: 44px;
    position: relative;
    overflow: hidden;
}

.primary-button {
    background: linear-gradient(135deg, var(--primary-color) 0%, #B8941F 100%);
    color: var(--background-color);
    box-shadow: 
        0 4px 15px rgba(212, 175, 55, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    font-weight: var(--font-weight-bold);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.primary-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #FFD700 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(212, 175, 55, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.primary-button:active {
    transform: translateY(0);
}

.primary-button:disabled {
    background: var(--border-color);
    color: var(--text-secondary);
    cursor: not-allowed;
}

/* Shop Next Round Button */
.shop-next-round-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--spacing-lg);
    padding-bottom: calc(var(--spacing-lg) + var(--safe-area-bottom));
    background: linear-gradient(180deg, transparent 0%, rgba(15, 10, 26, 0.9) 50%, rgba(15, 10, 26, 0.95) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 200;
}

.large-next-round-btn {
    width: 100%;
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    font-size: 20px;
    font-weight: var(--font-weight-bold);
    font-family: var(--font-system);
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: none;
    position: relative;
    overflow: hidden;
}

.large-next-round-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.large-next-round-btn:hover {
    transform: translateY(-3px);
    background: var(--primary-color);
    color: var(--background-color);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
}

.large-next-round-btn:hover::before {
    left: 100%;
}

.large-next-round-btn:active {
    transform: translateY(-1px);
}

.secondary-button {
    background: var(--surface-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.secondary-button:hover:not(:disabled) {
    background: var(--border-color);
    transform: translateY(-1px);
}

.danger-button {
    background: var(--danger-color);
    color: white;
}

.danger-button:hover:not(:disabled) {
    background: #D70015;
    transform: translateY(-1px);
}

.button-icon {
    font-size: 18px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: var(--spacing-md);
}

.action-buttons button {
    flex: 1;
}

/* Plays Grid */
.plays-grid {
    display: flex;
    gap: var(--spacing-xs);
    width: 100%;
    min-height: 80px;
}

/* Play slot sizing based on total plays */
.plays-grid .play-item,
.plays-grid .empty-play-slot {
    flex: 1;
    min-width: 0;
}

.plays-grid::-webkit-scrollbar {
    height: 4px;
}

.plays-grid::-webkit-scrollbar-track {
    background: var(--surface-color);
    border-radius: 2px;
}

.plays-grid::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}

.empty-play-slot,
.play-item {
    background: linear-gradient(145deg, var(--surface-color) 0%, #241837 100%);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 2px 4px rgba(0, 0, 0, 0.2);
}

.empty-play-slot {
    opacity: 0.6;
    border-style: dashed;
}

.play-item {
    background: linear-gradient(145deg, var(--surface-color) 0%, #241837 100%);
    animation: playItemSlideIn 0.3s ease;
}

@keyframes playItemSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Removed green left side line from play items */

.play-info {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    gap: 0px;
}

.play-info h3 {
    font-size: 12px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0;
    line-height: 1.1;
}

.play-status {
    font-size: 10px;
    color: var(--text-secondary);
    font-style: italic;
}

.play-hand {
    font-size: 11px;
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    line-height: 1.1;
}

.play-score {
    font-size: 12px;
    font-weight: var(--font-weight-bold);
    background: linear-gradient(135deg, var(--success-color) 0%, #66D17A 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-top: 2px;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: var(--spacing-lg);
}

.round-total {
    text-align: center;
    padding: var(--spacing-md);
    background: var(--surface-color);
    border-radius: var(--radius-md);
    margin-top: var(--spacing-md);
    border: 1px solid var(--border-color);
    font-size: 18px;
}

/* Bonus Items */
.bonus-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.bonus-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    background: var(--surface-color);
    border-radius: var(--radius-md);
    border: 1px solid var(--primary-color);
}

.bonus-name {
    font-weight: var(--font-weight-medium);
    color: var(--primary-color);
}

.use-bonus {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
}

/* Obtained Items */
.obtained-items {
    background: var(--card-bg);
    border: 2px solid var(--accent-blue);
    border-radius: 12px;
    padding: 16px;
    margin: 8px 0;
}

.obtained-subtitle {
    color: var(--text-muted);
    font-style: italic;
    margin: 8px 0 16px 0;
    text-align: center;
    font-size: 0.9em;
}

.obtained-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.obtained-item {
    background: linear-gradient(145deg, var(--card-color) 0%, #3A2F4A 100%);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.obtained-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.1), transparent);
    transition: left 0.5s ease;
}

.obtained-item:hover {
    border-color: var(--primary-color);
    box-shadow: 
        0 8px 25px rgba(212, 175, 55, 0.2),
        0 0 0 1px rgba(212, 175, 55, 0.3);
    transform: translateY(-2px);
}

.obtained-item:hover::before {
    left: 100%;
}

.obtained-item.activated {
    border-color: var(--success-color);
    background: rgba(52, 199, 89, 0.2);
}

.obtained-item.activated::before {
    background: linear-gradient(90deg, transparent, rgba(52, 199, 89, 0.1), transparent);
}

.obtained-item .item-icon {
    font-size: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--surface-color) 0%, #241837 100%);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.3);
}

.obtained-item .item-info {
    flex: 1;
}

.obtained-item .item-info h3 {
    font-size: 16px;
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.obtained-item .item-info p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.activate-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 14px;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    min-width: 80px;
    transition: all 0.2s ease;
}

.activate-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.activate-btn.activated {
    background: var(--success-color);
    color: white;
    cursor: default;
}

/* Compact Items Row - Redesigned */
.items-row {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-sm);
    padding: var(--spacing-xs);
    background: var(--background-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.items-horizontal {
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.items-horizontal .obtained-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-xs);
    background: var(--background-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 50px;
    position: relative;
}

.items-horizontal .obtained-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.items-horizontal .obtained-item.activated {
    background: var(--success-light);
    border-color: var(--success-color);
}

.items-horizontal .obtained-item .item-icon {
    font-size: 1.2rem;
    margin-bottom: 2px;
}

.items-horizontal .obtained-item .item-info {
    display: block;
    text-align: center;
}

.items-horizontal .obtained-item .item-info h3 {
    font-size: 0.65rem;
    margin: 0 0 3px 0;
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.1;
}

.items-horizontal .obtained-item .item-info p {
    display: none; /* Hide descriptions on game screen */
}

.items-horizontal .activate-btn {
    font-size: 0.6rem;
    padding: 2px 4px;
    margin-top: 2px;
    min-height: auto;
    line-height: 1.2;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 3px;
}

.items-horizontal .activate-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.items-horizontal .activate-btn.activated {
    background: var(--success-color);
    color: white;
    font-size: 0.55rem;
    padding: 1px 3px;
}

.items-horizontal .activate-btn.purchased {
    background: transparent;
    color: var(--success-color);
    border: 2px solid var(--success-color);
}

.activate-btn.activated:hover {
    background: var(--success-color);
    transform: none;
}

/* Items Grid - Matching Plays Section Style */
.items-section {
    margin-bottom: 0;
}

/* Shop mode active styling */
.items-section.shop-active {
    background: linear-gradient(145deg, var(--card-color) 0%, rgba(212, 175, 55, 0.05) 100%);
}

/* Only show yellow border when purchases are actually available */
.items-section.shop-active.purchases-available {
    border: 2px solid var(--primary-color);
    box-shadow: 
        0 0 20px rgba(212, 175, 55, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.shop-header h2 {
    margin-bottom: 0;
}

.money-counter {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: var(--surface-color);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    font-weight: var(--font-weight-semibold);
    color: var(--primary-color);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.money-icon {
    font-size: 1.1em;
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: var(--spacing-sm);
    width: 100%;
    min-height: 110px;
}

.items-grid .item-slot {
    background: linear-gradient(145deg, var(--surface-color) 0%, #241837 100%);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 2px 4px rgba(0, 0, 0, 0.2);
    min-height: 55px;
}

.items-grid .item-slot.unpurchased {
    opacity: 0.4;
    border-style: dashed;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, #1a1425 100%);
}

/* In shop mode, make purchasable items fully visible */
.items-section.shop-active .items-grid .item-slot.unpurchased {
    opacity: 1;
    border-style: solid;
    background: linear-gradient(145deg, var(--surface-color) 0%, #241837 100%);
}

.items-grid .item-slot.activated {
    border-color: var(--success-color);
    background: linear-gradient(145deg, rgba(80, 200, 120, 0.15) 0%, #241837 100%);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 2px 8px rgba(80, 200, 120, 0.3),
        0 0 20px rgba(80, 200, 120, 0.1);
}

.items-grid .item-slot:not(.unpurchased):hover {
    transform: translateY(-2px);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 4px 15px rgba(0, 0, 0, 0.3);
}

.items-grid .item-slot .item-icon {
    font-size: 20px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--surface-color) 0%, #1a1425 100%);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
}



.items-grid .item-slot .item-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    flex: 1;
}

.items-grid .item-slot .item-info {
    text-align: center;
    width: 100%;
}

.items-grid .item-slot .item-info h3 {
    font-size: 12px;
    font-weight: var(--font-weight-semibold);
    margin: 0;
    color: var(--text-primary);
    line-height: 1.2;
    text-align: center;
}

.items-grid .item-slot.unpurchased .item-info h3 {
    color: var(--text-secondary);
}

.items-grid .activate-btn {
    background: #FFD700;
    color: #000;
    border: none;
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 11px;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    min-width: 60px;
    transition: all 0.2s ease;
    height: 32px;
    flex-shrink: 0;
}

.items-grid .activate-btn:hover:not(:disabled) {
    transform: scale(1.05);
}

.items-grid .activate-btn.activated {
    background: var(--success-color);
    color: white;
    cursor: default;
}

.items-grid .activate-btn.disabled {
    background: var(--surface-color);
    color: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Shop-specific button states */
.items-grid .activate-btn.purchasable {
    background: transparent;
    color: #FFD700;
    border: 2px solid #FFD700;
}

.items-grid .activate-btn.purchasable:hover:not(:disabled) {
    background: rgba(255, 215, 0, 0.1);
    transform: scale(1.05);
}

.items-grid .activate-btn.purchased {
    background: transparent;
    color: var(--success-color);
    border: 2px solid var(--success-color);
}

.items-grid .activate-btn.insufficient-funds {
    background: #666;
    color: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.5;
}

/* Item pricing display */
/* Responsive adjustments for items grid */
@media (max-width: 768px) {
    .items-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 4px;
    }
    
    .items-grid .item-slot .item-info h3 {
        font-size: 9px;
    }
    
    .items-grid .activate-btn {
        font-size: 8px;
        padding: 1px 4px;
        min-width: 40px;
    }
}

@media (max-width: 480px) {
    .items-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(2, 1fr);
        gap: var(--spacing-xs);
    }
    
    .items-grid .item-slot {
        padding: var(--spacing-xs);
        min-height: 55px;
        gap: var(--spacing-xs);
    }
    
    .items-grid .item-slot .item-icon {
        font-size: 16px;
        width: 24px;
        height: 24px;
    }
    
    .items-grid .item-slot .item-info h3 {
        font-size: 10px;
    }
    
    .items-grid .activate-btn {
        font-size: 9px;
        padding: 4px 8px;
        min-width: 45px;
        height: 26px;
    }
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 10, 26, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 2px solid var(--primary-color);
    padding: var(--spacing-sm);
    padding-bottom: calc(var(--spacing-sm) + var(--safe-area-bottom));
    display: flex;
    justify-content: space-around;
    z-index: 100;
    overflow-x: auto;
    box-shadow: 
        0 -4px 20px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(212, 175, 55, 0.1);
}

.nav-item,
.nav-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    cursor: pointer;
    min-width: 60px;
    font-family: var(--font-system);
}

.nav-item.active,
.nav-btn.active {
    color: var(--primary-color);
}

.nav-item:hover,
.nav-btn:hover {
    background: var(--surface-color);
}

.nav-icon {
    font-size: 20px;
}

.nav-label {
    font-size: 10px;
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Views */
.view {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--background-color);
    z-index: 200;
    overflow-y: auto;
    padding-top: var(--safe-area-top);
    padding-bottom: var(--safe-area-bottom);
}

/* Main Menu View */
.main-menu-view {
    background: linear-gradient(135deg, var(--background-color) 0%, #1A0F2E 50%, var(--background-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
}

.main-menu-content {
    padding: var(--spacing-md);
    max-width: 768px;
    margin: 0 auto;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--safe-area-top) - var(--safe-area-bottom));
}

.game-logo h1 {
    font-size: 48px;
    font-weight: var(--font-weight-bold);
    background: linear-gradient(135deg, var(--primary-color) 0%, #FFD700 50%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-md);
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.4);
    letter-spacing: 2px;
}

.game-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
    margin: 0;
}

.main-menu-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.menu-button {
    width: 100%;
    font-size: 18px;
    padding: var(--spacing-md) var(--spacing-lg);
    min-height: 52px;
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.menu-button:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.menu-button:active {
    transform: translateY(-1px);
}

.menu-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.menu-button:active::before {
    width: 200%;
    height: 200%;
}

/* Main menu animations */
.main-menu-content {
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-logo h1 {
    animation: logoGlow 2s ease-in-out infinite alternate;
}

@keyframes logoGlow {
    from {
        text-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
    }
    to {
        text-shadow: 0 0 30px rgba(212, 175, 55, 0.6);
    }
}

.view-header {
    background: rgba(28, 28, 30, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-sm) var(--spacing-md);
    position: sticky;
    top: var(--safe-area-top);
    z-index: 50;
    width: 100%;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    padding-left: calc(50vw - 50% + var(--spacing-md));
    padding-right: calc(50vw - 50% + var(--spacing-md));
}

.back-button,
.rules-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 12px;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    padding: var(--spacing-xs);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    font-family: var(--font-system);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    min-width: 40px;
}

.back-button {
    left: var(--spacing-md);
}

.rules-button {
    right: var(--spacing-md);
}

.back-button:hover,
.rules-button:hover {
    background: var(--surface-color);
    transform: translateY(-50%) scale(1.05);
}

.back-button .button-icon,
.rules-button .button-icon {
    font-size: 14px;
    line-height: 1;
}

.back-button .button-text,
.rules-button .button-text {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
}

.view-header h1 {
    font-size: 20px;
    font-weight: var(--font-weight-bold);
    text-align: center;
    margin-bottom: var(--spacing-xs);
}

.available-points {
    text-align: center;
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: var(--font-weight-medium);
}

/* Shop Styles */
.shop-view {
    padding-bottom: calc(80px + var(--safe-area-bottom));
}

.shop-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.shop-item {
    background: linear-gradient(145deg, var(--card-color) 0%, #3A2F4A 100%);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.shop-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.1), transparent);
    transition: left 0.5s ease;
}

.shop-item:hover {
    border-color: var(--primary-color);
    box-shadow: 
        0 8px 25px rgba(212, 175, 55, 0.2),
        0 0 0 1px rgba(212, 175, 55, 0.3);
    transform: translateY(-2px);
}

.shop-item:hover::before {
    left: 100%;
}

.shop-item.owned {
    border-color: var(--success-color);
    background: rgba(52, 199, 89, 0.1);
}

.shop-item.owned .buy-button {
    background: var(--success-color);
    color: white;
}

.item-icon {
    font-size: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--surface-color) 0%, #241837 100%);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.3);
}

.item-info {
    flex: 1;
}

.item-info h3 {
    font-size: 16px;
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-xs);
}

.item-info p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.item-cost {
    font-size: 14px;
    font-weight: var(--font-weight-bold);
    color: var(--warning-color);
}

.buy-button {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 14px;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    min-width: 80px;
    transition: all 0.2s ease;
}

.buy-button:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.buy-button:disabled {
    background: var(--border-color);
    color: var(--text-secondary);
    cursor: not-allowed;
}

/* Rules Styles */
.rules-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.rule-section {
    background: var(--card-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 1px solid var(--border-color);
}

.rule-section h2 {
    font-size: 20px;
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-md);
    color: var(--primary-color);
}

.rule-section p {
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

.rule-section ul {
    padding-left: var(--spacing-lg);
}

.rule-section li {
    margin-bottom: var(--spacing-sm);
    line-height: 1.6;
}

.score-table {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.score-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    background: var(--surface-color);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.score-row span:last-child {
    font-weight: var(--font-weight-bold);
    background: linear-gradient(135deg, var(--success-color) 0%, #66D17A 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Rules Hand Examples */
.rules-hand-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.rules-hand-item {
    background: var(--surface-color);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: var(--spacing-md);
    transition: all 0.2s ease;
}

.rules-hand-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.1);
}

.rules-hand-item .hand-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.rules-hand-item .hand-header h3 {
    font-size: 16px;
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin: 0;
}

.rules-hand-item .hand-points {
    font-size: 14px;
    font-weight: var(--font-weight-bold);
    background: linear-gradient(135deg, var(--success-color) 0%, #66D17A 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.rules-hand-item .hand-example {
    font-size: 16px;
    font-weight: var(--font-weight-medium);
    color: var(--primary-color);
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    letter-spacing: 1px;
    text-align: center;
}

/* Bonus Shop Reference in Rules */
.bonus-shop-reference {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.bonus-item-ref {
    display: grid;
    grid-template-columns: 40px 1fr 80px 2fr;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: var(--surface-color);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.bonus-item-ref .bonus-emoji {
    font-size: 20px;
    text-align: center;
}

.bonus-item-ref .bonus-name {
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.bonus-item-ref .bonus-cost {
    font-size: 12px;
    font-weight: var(--font-weight-bold);
    color: var(--primary-color);
    text-align: center;
}

.bonus-item-ref .bonus-desc {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Credits Link in Rules */
.credits-link {
    background: none;
    border: none;
    color: var(--primary-color);
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: all 0.2s ease;
    padding: 0;
}

.credits-link:hover {
    text-decoration-color: var(--primary-color);
    transform: scale(1.05);
}

/* Stats Styles */
.stats-content {
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.stat-card {
    background: var(--card-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 1px solid var(--border-color);
}

.stat-card h2 {
    font-size: 20px;
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-md);
    color: var(--primary-color);
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

.stat-item {
    text-align: center;
    padding: var(--spacing-lg);
    background: var(--surface-color);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.stat-value {
    display: block;
    font-size: 32px;
    font-weight: var(--font-weight-bold);
    color: var(--primary-color);
    margin-bottom: var(--spacing-xs);
}

.stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: var(--font-weight-medium);
}

/* Achievements */
.achievement-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.achievement {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--surface-color);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.achievement.unlocked {
    border-color: var(--success-color);
    background: rgba(52, 199, 89, 0.1);
}

.achievement-icon {
    font-size: 24px;
    width: 40px;
    text-align: center;
}

.achievement-name {
    flex: 1;
    font-weight: var(--font-weight-medium);
}

.achievement-status {
    font-size: 16px;
}

.reset-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
}

.modal {
    background: linear-gradient(145deg, var(--card-color) 0%, #3A2F4A 100%);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    border: 2px solid var(--primary-color);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(212, 175, 55, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    max-width: 400px;
    width: 100%;
    text-align: center;
    animation: modalSlideIn 0.3s ease;
    position: relative;
}

.modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.05) 0%, transparent 50%);
    border-radius: var(--radius-xl);
    pointer-events: none;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Exit Modal Styles */
.exit-modal {
    max-width: 350px;
    text-align: center;
}

.exit-modal .modal-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
    display: block;
}

.exit-modal h2 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
}

.exit-modal .modal-content p {
    margin-bottom: var(--spacing-sm);
    line-height: 1.5;
}

.exit-modal .modal-subtitle {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 14px;
}

.modal h2 {
    font-size: 24px;
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-lg);
    color: var(--primary-color);
}

.modal-content {
    margin-bottom: var(--spacing-lg);
}

.modal-content p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

.modal-stats {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: var(--surface-color);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.modal-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-stat span:last-child {
    font-weight: var(--font-weight-bold);
    color: var(--primary-color);
}

.modal-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* Responsive Design */
@media (max-width: 375px) {
    .status-row {
        gap: 2px;
    }
    
    .status-item {
        padding: 1px var(--spacing-xs);
    }
    
    .stat-grid {
        grid-template-columns: 1fr;
    }
    
    .main-menu-view {
        padding: var(--spacing-md);
        padding-top: var(--spacing-xl);
    }
    
    .main-menu-content {
        max-width: 300px;
        gap: var(--spacing-lg);
    }
    
    .game-logo h1 {
        font-size: 36px;
    }
    
    .menu-button {
        font-size: 16px;
        padding: var(--spacing-lg);
        min-height: 50px;
    }
    
    .view-header h1 {
        font-size: 24px;
    }
    
    .back-button,
    .rules-button {
        font-size: 12px;
        min-width: 40px;
        padding: 4px;
    }
    
    .back-button .button-icon,
    .rules-button .button-icon {
        font-size: 14px;
    }
    
    .back-button .button-text,
    .rules-button .button-text {
        font-size: 9px;
    }
    
    .result-stats {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    .shop-items-grid {
        grid-template-columns: 1fr;
    }
}

/* Touch Feedback */
.primary-button:active,
.secondary-button:active,
.danger-button:active,
.nav-item:active,
.buy-button:active,
.use-bonus:active {
    transform: scale(0.98);
}

/* Loading States */
.loading {
    position: relative;
    color: transparent !important;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Haptic Feedback Simulation */
@media (hover: none) and (pointer: coarse) {
    .primary-button:active,
    .secondary-button:active,
    .nav-item:active {
        transition: transform 0.1s ease;
    }
}

/* PWA Specific Styles */
@media (display-mode: standalone) {
    body {
        padding-top: 0;
    }
    
    .status-bar-spacer {
        display: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #606060;
        --text-secondary: #B0B0B0;
    }
}

/* Credits Styles */
.credits-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.credit-card {
    background: var(--card-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 1px solid var(--border-color);
}

.credit-card h2 {
    font-size: 20px;
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-md);
    color: var(--primary-color);
}

.main-credit {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    border: 2px solid var(--primary-color);
}

.creator-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    flex-shrink: 0;
    object-fit: cover;
    background: var(--surface-color);
}

.creator-info h2 {
    font-size: 24px;
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.creator-title {
    font-size: 16px;
    color: var(--primary-color);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-sm);
}

.creator-description {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.links-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.official-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: var(--surface-color);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.official-link:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.official-link.youtube:hover {
    border-color: #FF0000;
}

.official-link.patreon:hover {
    border-color: #FF424D;
}

.official-link .link-icon {
    font-size: 24px;
    width: 40px;
    text-align: center;
}

.official-link .link-info {
    flex: 1;
}

.official-link .link-info h3 {
    font-size: 16px;
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--spacing-xs);
}

.official-link .link-info p {
    font-size: 14px;
    color: var(--text-secondary);
}

.official-link .link-arrow {
    font-size: 20px;
    color: var(--text-secondary);
}

.creator-links {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.creator-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--surface-color);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: var(--font-weight-medium);
    transition: all 0.2s ease;
}

.creator-link:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.credits-section {
    border: 1px solid var(--primary-color);
    background: rgba(0, 122, 255, 0.05);
}

.disclaimer {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
    font-style: italic;
    padding: var(--spacing-md);
    background: var(--surface-color);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--warning-color);
}

/* Add to Home Screen Prompt */
.add-to-home-prompt {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(145deg, var(--card-color) 0%, #3A2F4A 100%);
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-md);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: slideUpPrompt 0.3s ease;
}

@keyframes slideUpPrompt {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.add-to-home-content {
    max-width: 400px;
    margin: 0 auto;
}

.add-to-home-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.add-to-home-header span {
    font-size: 20px;
}

.add-to-home-header h3 {
    flex: 1;
    margin: 0;
    font-size: 16px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.close-prompt-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.close-prompt-btn:hover {
    background: var(--surface-color);
    color: var(--text-primary);
}

.add-to-home-content p {
    margin: 0 0 var(--spacing-md) 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.4;
}

.add-to-home-buttons {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.add-to-home-buttons button {
    flex: 1;
    min-width: 120px;
}

/* Installation Instructions Modal */
.install-instructions-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
}

.modal-overlay-install {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
}

.modal-install {
    background: linear-gradient(145deg, var(--card-color) 0%, #3A2F4A 100%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    max-width: 400px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: modalFadeIn 0.3s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.close-modal-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.close-modal-btn:hover {
    background: var(--surface-color);
    color: var(--text-primary);
}

.modal-content-install {
    padding: var(--spacing-md);
}

.instruction-step {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md);
    background: var(--surface-color);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.step-number {
    background: var(--primary-color);
    color: var(--background-color);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-weight-bold);
    font-size: 14px;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content p {
    margin: 0;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.4;
}

.step-icon {
    font-size: 20px;
    margin-top: var(--spacing-xs);
    text-align: center;
}

.instruction-note {
    background: linear-gradient(145deg, var(--warning-color) 10%, rgba(255, 193, 7, 0.1) 100%);
    border: 1px solid var(--warning-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.instruction-note p {
    margin: 0;
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.4;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

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