/*
 * Tetris Game - Styles
 */

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7e22ce 100%);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 20px 10px;
}

.game-container {
    display: flex;
    gap: 30px;
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 100%;
    width: fit-content;
}

/* Fallback for Firefox (backdrop-filter not supported) */
@supports not (backdrop-filter: blur(10px)) {
    .game-container {
        background: rgba(255, 255, 255, 0.3);
    }
}

.left-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 200px;
    width: 200px;
}

.info-box {
    background: rgba(255, 255, 255, 0.15);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Fallback for Firefox */
@supports not (backdrop-filter: blur(5px)) {
    .info-box {
        background: rgba(255, 255, 255, 0.25);
    }
}

.info-box h2 {
    color: #fff;
    font-size: 16px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.score-display {
    color: var(--warning);
    font-size: 32px;
    font-weight: bold;
    text-shadow: 0 2px 10px rgba(251, 191, 36, 0.5);
}

.level-display {
    color: var(--info);
    font-size: 28px;
    font-weight: bold;
    text-shadow: 0 2px 10px rgba(96, 165, 250, 0.5);
}

.next-piece {
    width: 120px;
    height: 120px;
    margin: 10px auto;
    position: relative;
}

.canvas-container {
    position: relative;
}

canvas {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    display: block;
}

.controls {
    background: rgba(255, 255, 255, 0.15);
    padding: 15px;
    border-radius: 15px;
    color: white;
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    font-size: 12px;
}

/* Fallback for Firefox */
@supports not (backdrop-filter: blur(5px)) {
    .controls {
        background: rgba(255, 255, 255, 0.25);
    }
}

.controls h3 {
    margin-bottom: 10px;
    text-align: center;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.controls p {
    margin: 4px 0;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
}

.key {
    background: rgba(255, 255, 255, 0.2);
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 10px;
    min-width: 24px;
    text-align: center;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

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

.game-over-box {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.game-over-box h1 {
    color: white;
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.game-over-box p {
    color: white;
    font-size: 24px;
    margin: 10px 0;
}

button {
    margin-top: 20px;
    padding: 15px 40px;
    font-size: 18px;
    background: white;
    color: var(--primary);
    border: none;
    border-radius: 10px;
    font-weight: bold;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.home-button {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    text-decoration: none;
    display: inline-block;
    padding: 12px 30px;
    border-radius: 10px;
    font-weight: bold;
    margin-top: 10px;
}

/* Fallback for Firefox */
@supports not (backdrop-filter: blur(5px)) {
    .home-button {
        background: rgba(255, 255, 255, 0.25);
    }
}

.home-button:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

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

.particle {
    position: absolute;
    pointer-events: none;
    animation: particleFloat 1s ease-out forwards;
}

/* Button Row */
.button-row {
    width: 100%;
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.button-row button,
.button-row .home-button {
    flex: 1;
}

/* Controls Banner */
.controls-banner {
    display: none; /* Desktop'ta gizli */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 2px solid rgba(102, 126, 234, 0.3);
    padding: 10px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 50;
}

/* Fallback for Firefox */
@supports not (backdrop-filter: blur(10px)) {
    .controls-banner {
        background: rgba(255, 255, 255, 0.98);
    }
}

.controls-content {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}

.control-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #333;
}

.control-item .key {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 12px;
    min-width: 35px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.control-item span:last-child {
    font-weight: 500;
    white-space: nowrap;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .game-container {
        gap: 20px;
        padding: 20px;
    }

    .left-panel {
        width: 180px;
        min-width: 180px;
    }

    .controls {
        padding: 12px;
    }

    .controls h3 {
        font-size: 13px;
        margin-bottom: 8px;
    }

    .controls p {
        font-size: 10px;
        margin: 3px 0;
    }
}

@media (max-width: 1024px) {
    body {
        overflow-y: auto;
        padding: 20px 10px;
    }

    .game-container {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
        max-width: 100%;
    }

    .left-panel {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
        width: 100%;
        min-width: auto;
    }

    .info-box {
        flex: 1;
        min-width: 150px;
        padding: 15px;
    }

    .info-box h2 {
        font-size: 14px;
    }

    .score-display {
        font-size: 24px;
    }

    .level-display {
        font-size: 20px;
    }

    .controls {
        width: 100%;
        padding: 15px;
    }

    .controls h3 {
        font-size: 16px;
    }

    .controls p {
        font-size: 13px;
    }

    canvas {
        max-width: 100%;
        height: auto;
    }
}

@media (max-width: 768px) {
    body {
        padding-bottom: 80px; /* Banner için yer bırak */
    }

    .game-container {
        padding: 15px;
        gap: 15px;
    }

    .left-panel {
        gap: 10px;
        flex-direction: row;
    }

    .info-box {
        padding: 10px;
        min-width: 120px;
        flex: 1;
    }

    .info-box h2 {
        font-size: 12px;
        margin-bottom: 5px;
    }

    .score-display {
        font-size: 20px;
    }

    .level-display {
        font-size: 18px;
    }

    .next-piece {
        width: 80px;
        height: 80px;
    }

    /* Eski kontrol panelini gizle */
    .controls {
        display: none !important;
    }

    /* Banner'ı göster */
    .controls-banner {
        display: block;
    }

    #muteBtn {
        width: 100%;
    }

    button {
        padding: 12px 20px;
        font-size: 16px;
    }

    .home-button {
        padding: 10px 20px;
        font-size: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        box-sizing: border-box;
    }

    .button-row {
        gap: 8px;
    }

    .game-over-box {
        padding: 30px 20px;
        max-width: 90%;
    }

    .game-over-box h1 {
        font-size: 32px;
    }

    .game-over-box p {
        font-size: 18px;
    }

    .canvas-container {
        width: 100%;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px 5px;
    }

    .game-container {
        padding: 10px;
        gap: 10px;
        border-radius: 15px;
    }

    .left-panel {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 8px;
    }

    .info-box {
        flex: 1;
        min-width: calc(50% - 4px);
        padding: 8px;
    }

    .info-box h2 {
        font-size: 11px;
    }

    .score-display {
        font-size: 18px;
    }

    .level-display {
        font-size: 16px;
    }

    .next-piece {
        width: 60px;
        height: 60px;
    }

    /* Kontrolleri tamamen gizle */
    .controls {
        display: none !important;
    }

    /* Mute butonunu gizle veya küçült */
    #muteBtn {
        position: fixed;
        top: 10px;
        right: 10px;
        width: auto !important;
        padding: 8px 12px !important;
        font-size: 14px !important;
        z-index: 100;
        margin: 0 !important;
    }

    #tetris {
        width: 100%;
        max-width: 300px;
        height: auto;
    }

    button {
        padding: 10px 15px;
        font-size: 14px;
    }

    .home-button {
        padding: 8px 15px;
        font-size: 14px;
    }

    .game-over-box h1 {
        font-size: 24px;
    }

    .game-over-box p {
        font-size: 16px;
    }

    /* Canvas container tam genişlik */
    .canvas-container {
        width: 100%;
    }
}
