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

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: radial-gradient(circle at 20% 30%, #0a0f1e, #05070f);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Haupt-Wrapper für vertikales Layout */
.main-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100%;
    max-width: 1200px;
}

/* Hintergrund-Effekt mit animierten Partikeln */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 40%, rgba(255, 215, 0, 0.08) 2px, transparent 2px),
        radial-gradient(circle at 80% 70%, rgba(255, 100, 100, 0.08) 1px, transparent 1px);
    background-size: 50px 50px, 30px 30px;
    pointer-events: none;
    animation: starsFloat 60s linear infinite;
}

@keyframes starsFloat {
    0% { background-position: 0 0, 0 0; }
    100% { background-position: 100px 100px, -50px 50px; }
}

.game-container {
    background: rgba(15, 25, 45, 0.7);
    backdrop-filter: blur(12px);
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    justify-content: center;
    border: 1px solid rgba(255, 215, 0, 0.3);
    position: relative;
}

.game-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #ffd700, #ff6a88, #ffd700);
    border-radius: 26px;
    opacity: 0.3;
    z-index: -1;
    filter: blur(8px);
}

/* Spielbrett - 10x10 mit größeren Tiles */
.game-board {
    background: linear-gradient(145deg, #0a1428, #030617);
    border-radius: 20px;
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(10, 55px);
    grid-template-rows: repeat(10, 55px);
    gap: 6px;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.6), 0 10px 20px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.tile {
    background: linear-gradient(135deg, #ffb347, #ff6b35);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: bold;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    position: relative;
    transform: translateY(-2px);
    width: 100%;
    height: 100%;
}

/* Glow-Effekt für Tiles */
.tile::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    pointer-events: none;
    transition: box-shadow 0.2s ease;
}

.tile:hover::after {
    box-shadow: inset 0 0 15px rgba(255, 215, 0, 0.6);
}

.tile:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 5px 0 rgba(0, 0, 0, 0.3);
    filter: brightness(1.05);
}

.tile:active {
    transform: translateY(1px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}

.tile.selected {
    box-shadow: 0 0 0 3px #ffd700, 0 0 0 6px rgba(255, 215, 0, 0.5), 0 4px 0 rgba(0, 0, 0, 0.3);
    transform: translateY(-2px) scale(1.02);
    filter: brightness(1.1);
}

/* Hilfestellung - Hervorhebung der vorgeschlagenen Tiles */
.tile.help-highlight {
    animation: helpHighlight 0.8s ease-in-out infinite;
    box-shadow: 0 0 0 3px #ffd700, 0 0 0 8px rgba(255, 215, 0, 0.4), 0 4px 0 rgba(0, 0, 0, 0.3);
    transform: translateY(-2px) scale(1.03);
}

@keyframes helpHighlight {
    0%, 100% {
        box-shadow: 0 0 0 3px #ffd700, 0 0 0 8px rgba(255, 215, 0, 0.4), 0 4px 0 rgba(0, 0, 0, 0.3);
        filter: brightness(1);
    }
    50% {
        box-shadow: 0 0 0 4px #ffaa00, 0 0 0 12px rgba(255, 170, 0, 0.6), 0 4px 0 rgba(0, 0, 0, 0.3);
        filter: brightness(1.2);
    }
}

.tile.matched {
    animation: matchAnimation 0.4s ease-out forwards;
}

/* Info-Panel - größer */
.info-panel {
    background: linear-gradient(135deg, rgba(20, 30, 55, 0.9), rgba(10, 18, 35, 0.9));
    backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 20px;
    color: white;
    min-width: 240px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.score-box, .moves-box, .time-box, .best-score-box {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.3));
    border-radius: 16px;
    padding: 12px 15px;
    margin-bottom: 12px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 215, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.score-box::before, .moves-box::before, .time-box::before, .best-score-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    transition: left 0.5s ease;
}

.score-box:hover::before, .moves-box:hover::before, .time-box:hover::before, .best-score-box:hover::before {
    left: 100%;
}

.score-box:hover, .moves-box:hover, .time-box:hover, .best-score-box:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 215, 0, 0.3);
}

.score-box h3, .moves-box h3, .time-box h3, .best-score-box h3 {
    font-size: 12px;
    opacity: 0.8;
    letter-spacing: 1px;
    margin-bottom: 8px;
    text-transform: uppercase;
    font-weight: 500;
}

.score-box .value, .moves-box .value, .time-box .value, .best-score-box .value {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, #ffd89b, #ffb347);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: none;
    letter-spacing: 1px;
}

.best-score-box .value {
    font-size: 24px;
}

/* Trend-Anzeige */
.trend {
    font-size: 10px;
    margin-top: 5px;
    font-weight: 600;
}

.trend.up {
    color: #4caf50;
    animation: trendPulse 0.5s ease;
}

.trend.down {
    color: #ff6a6a;
}

@keyframes trendPulse {
    0% { opacity: 0; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}

/* Hilfestellung - Nachricht */
.help-message {
    background: linear-gradient(135deg, rgba(44, 62, 102, 0.9), rgba(26, 42, 68, 0.9));
    border-radius: 14px;
    padding: 10px 12px;
    margin: 12px 0;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    color: #ffd700;
    border-left: 4px solid #ffd700;
    transition: all 0.3s ease;
    opacity: 0.85;
    backdrop-filter: blur(4px);
}

.help-message.show {
    animation: helpPulse 0.6s ease-out;
    background: linear-gradient(135deg, #ff6a88, #ff99ac);
    color: white;
    border-left-color: white;
    opacity: 1;
    box-shadow: 0 4px 12px rgba(255, 106, 136, 0.3);
}

@keyframes helpPulse {
    0% {
        transform: scale(0.95);
        opacity: 0;
    }
    60% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.small-btn {
    padding: 8px 12px;
    font-size: 11px;
    background: linear-gradient(135deg, #3a4a8c, #2a3a6c);
}

.small-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

/* Game Controls */
.game-controls {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

/* Reset Button */
.reset-btn {
    background: linear-gradient(135deg, #ff6a88, #ff8a5c);
    margin-bottom: 12px;
    font-size: 14px;
    padding: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

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

.reset-btn:hover::before {
    width: 200px;
    height: 200px;
}

/* Highscore Tabelle */
.highscore {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 16px;
    padding: 12px;
    margin-top: 12px;
    backdrop-filter: blur(4px);
}

.highscore h3 {
    margin-bottom: 10px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    color: #ffd700;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

/* Clear Highscores Button */
.clear-btn {
    font-size: 12px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s;
    margin-left: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 20px;
}

.clear-btn:hover {
    opacity: 1;
    transform: scale(1.1);
    background: rgba(255, 0, 0, 0.3);
}

.highscore table {
    width: 100%;
    font-size: 12px;
    border-collapse: collapse;
}

.highscore th, .highscore td {
    padding: 6px 4px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 215, 0, 0.15);
}

.highscore th {
    color: #ffd700;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 1px;
}

.highscore td {
    color: rgba(255, 255, 255, 0.9);
}

.highscore tr:hover td {
    background: rgba(255, 215, 0, 0.1);
}

/* Buttons */
.btn {
    background: linear-gradient(135deg, #5a67d8, #7c3aed);
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    width: 100%;
    font-size: 14px;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
}

.btn::after {
    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;
}

.btn:hover::after {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(1px);
}

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

.btn:disabled:hover {
    transform: none;
    filter: none;
}

/* Start-Screen Overlay */
.start-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.4s ease;
}

.start-card {
    background: linear-gradient(135deg, #1e2a3a, #0f172a);
    border-radius: 32px;
    padding: 30px;
    text-align: center;
    color: white;
    max-width: 380px;
    width: 90%;
    animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.start-card h1 {
    font-size: 28px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #ffd700, #ff8a5c);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 800;
}

.start-card > p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
}

.start-info {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 15px;
    margin: 20px 0;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.info-item {
    padding: 8px 0;
    font-size: 13px;
    color: #ffd700;
    font-weight: 500;
}

.start-btn {
    background: linear-gradient(135deg, #ff6a88, #ff8a5c);
    font-size: 18px;
    padding: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-top: 10px;
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 106, 136, 0.4);
}

/* Pause Overlay */
.pause-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    backdrop-filter: blur(10px);
}

.pause-card {
    background: linear-gradient(135deg, #1e2a3a, #0f172a);
    border-radius: 32px;
    padding: 30px;
    text-align: center;
    max-width: 300px;
    width: 90%;
    border: 2px solid #ffd700;
    animation: slideUp 0.3s ease;
}

.pause-card h2 {
    font-size: 28px;
    margin-bottom: 15px;
    color: #ffd700;
}

.pause-card p {
    margin-bottom: 20px;
    color: white;
}

/* Game-Over-Menü */
.game-over-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.game-over-card {
    background: linear-gradient(135deg, #1a2a3f, #0f1a2a);
    border-radius: 32px;
    padding: 25px 20px;
    text-align: center;
    color: white;
    max-width: 320px;
    width: 90%;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.game-over-card h2 {
    font-size: 24px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #ffd700, #ff8a5c);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 800;
}

.game-over-card .reason {
    font-size: 14px;
    margin: 10px 0;
    color: #ffd700;
    font-weight: 500;
}

.game-over-card .final-stats {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 12px;
    margin: 15px 0;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.game-over-card .final-stats p {
    margin: 6px 0;
    font-size: 14px;
}

.game-over-card .final-stats strong {
    background: linear-gradient(135deg, #ffd700, #ffb347);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 22px;
    margin-left: 8px;
}

.game-over-card input {
    width: 100%;
    padding: 12px;
    margin: 12px 0;
    border: none;
    border-radius: 16px;
    font-size: 14px;
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    font-family: inherit;
    transition: all 0.2s;
}

.game-over-card input:focus {
    outline: none;
    box-shadow: 0 0 0 2px #ffd700;
    transform: scale(1.01);
}

.game-over-card .btn {
    margin: 8px 0;
    font-size: 14px;
    padding: 12px;
    border-radius: 16px;
}

.game-over-card .reset-btn {
    background: linear-gradient(135deg, #ff6a88, #ff8a5c);
}

/* Neue Bestleistung Badge */
.new-highscore-badge {
    background: linear-gradient(135deg, #ffd700, #ff8a5c);
    color: #1e2a3a;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: bold;
    margin: 12px auto;
    display: inline-block;
    animation: badgePulse 0.5s ease-out;
}

.no-highscore-message {
    background: rgba(255, 255, 255, 0.1);
    color: #ffd700;
    padding: 10px;
    border-radius: 12px;
    font-size: 12px;
    margin: 12px 0;
    text-align: center;
}

@keyframes badgePulse {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    80% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Partikel-Effekt */
.particle {
    position: fixed;
    pointer-events: none;
    font-size: 20px;
    animation: particleFloat 0.6s ease-out forwards;
    z-index: 1000;
}

@keyframes particleFloat {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-50px) scale(0.5);
        opacity: 0;
    }
}

/* Combo-Anzeige */
.combo-popup {
    position: fixed;
    font-size: 24px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    animation: comboFloat 1s ease-out forwards;
    pointer-events: none;
    z-index: 1000;
}

@keyframes comboFloat {
    0% {
        transform: translateY(0) scale(0.5);
        opacity: 0;
    }
    20% {
        transform: translateY(-20px) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translateY(-80px) scale(0.8);
        opacity: 0;
    }
}

/* Footer Styles - unter dem Spiel */
.game-footer {
    text-align: center;
    padding: 12px 24px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5px;
    background: rgba(10, 20, 35, 0.5);
    backdrop-filter: blur(8px);
    border-radius: 40px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    transition: all 0.3s ease;
    width: auto;
    margin: 0 auto;
}

.game-footer:hover {
    color: #ffd700;
    border-color: rgba(255, 215, 0, 0.5);
    transform: translateY(-2px);
    background: rgba(10, 20, 35, 0.7);
}

/* Responsive Design */
@media (max-width: 900px) {
    .game-board {
        grid-template-columns: repeat(10, 45px);
        grid-template-rows: repeat(10, 45px);
        gap: 4px;
        padding: 10px;
    }
    
    .tile {
        font-size: 22px;
        border-radius: 10px;
    }
    
    .info-panel {
        min-width: 210px;
        padding: 15px;
    }
    
    .score-box .value, .moves-box .value, .time-box .value {
        font-size: 24px;
    }
    
    .best-score-box .value {
        font-size: 20px;
    }
}

@media (max-width: 750px) {
    .game-board {
        grid-template-columns: repeat(10, 38px);
        grid-template-rows: repeat(10, 38px);
        gap: 3px;
        padding: 8px;
    }
    
    .tile {
        font-size: 18px;
        border-radius: 8px;
    }
    
    .info-panel {
        min-width: 190px;
        padding: 12px;
    }
    
    .score-box .value, .moves-box .value, .time-box .value {
        font-size: 20px;
    }
    
    .best-score-box .value {
        font-size: 18px;
    }
    
    .score-box h3, .moves-box h3, .time-box h3, .best-score-box h3 {
        font-size: 10px;
    }
    
    .small-btn {
        font-size: 9px;
        padding: 6px 8px;
    }
    
    .btn {
        font-size: 12px;
        padding: 10px 12px;
    }
    
    .reset-btn {
        font-size: 12px;
        padding: 10px;
    }
    
    .game-footer {
        font-size: 11px;
        padding: 10px 20px;
    }
}

@media (max-width: 650px) {
    .game-board {
        grid-template-columns: repeat(10, 32px);
        grid-template-rows: repeat(10, 32px);
        gap: 2px;
        padding: 6px;
    }
    
    .tile {
        font-size: 16px;
        border-radius: 6px;
    }
    
    .info-panel {
        min-width: 170px;
        padding: 10px;
    }
    
    .score-box .value, .moves-box .value, .time-box .value {
        font-size: 18px;
    }
    
    .best-score-box .value {
        font-size: 16px;
    }
    
    .score-box h3, .moves-box h3, .time-box h3, .best-score-box h3 {
        font-size: 9px;
    }
    
    .help-message {
        font-size: 10px;
        padding: 8px;
    }
    
    .action-buttons {
        gap: 5px;
    }
    
    .small-btn {
        font-size: 8px;
        padding: 5px 6px;
    }
    
    .game-footer {
        font-size: 9px;
        padding: 8px 16px;
    }
}

/* Animationen */
@keyframes matchAnimation {
    0% { 
        transform: scale(1) translateY(-2px);
        opacity: 1;
    }
    30% { 
        transform: scale(1.2) translateY(-3px);
        background: #ffd700;
    }
    100% { 
        transform: scale(0) translateY(0);
        opacity: 0;
    }
}

@keyframes fallAnimation {
    from { 
        transform: translateY(-40px) rotate(5deg);
        opacity: 0;
    }
    to { 
        transform: translateY(0) rotate(0);
        opacity: 1;
    }
}

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

.tile.falling {
    animation: fallAnimation 0.25s ease-out;
}

/* Timer Warnung */
#time {
    transition: all 0.3s ease;
}

/* Scrollbar */
.highscore {
    overflow-x: auto;
}

.highscore::-webkit-scrollbar {
    height: 4px;
}

.highscore::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.highscore::-webkit-scrollbar-thumb {
    background: #ffd700;
    border-radius: 4px;
}