@font-face {
    font-family: "Tetrizz";
    src: url("assets/fonts/Tetrizz.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
}

/* =====================
   RESET + BASE
===================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Tetrizz", Helvetica, sans-serif;
}

body {
    background-color: #0f1220;
    color: #ffffff;
    height: 100vh;
    overflow: hidden; /* ❗ bilinçli, dokunmadık */
}

/* =====================
   LAYOUT
===================== */

.layout {
    display: flex;
    height: 100%;
    align-items: stretch;
}

/* =====================
   LEFT CONTAINER
===================== */

.left-container {
    width: 33.3vw;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* =====================
   TOP MENU
===================== */

.top-menu {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}

/* =====================
   MENU ITEM
===================== */

.menu_box {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    white-space: nowrap;
    padding: 6px 16px;
    font-size: clamp(10px, 1vw, 14px);
}

.menu_box::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background-color: white;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
}

.menu_box:hover::after {
    transform: translateX(0);
}

/* =====================
   LOGO
===================== */

.logo {
    max-height: 80px;
    width: auto;
    display: block;
}

/* =====================
   MID MENU
===================== */

.mid_menu {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.last_scores {
    width: 100%;
    padding-top: 80px;
}

/* =====================
   SCORES
===================== */

.best_score {
    padding: 10px;
    font-size: clamp(14px, 1.4vw, 22px);
    color: gold;
}

.score_box {
    padding-top: 10px;
    font-size: clamp(12px, 1.2vw, 18px);
}

/* =====================
   BOTTOM MENU
===================== */

.bottom_menu {
    width: 100%;
    display: flex;
    justify-content: flex-end;
}

.level_score {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* TIME */
.timer {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-bottom: 16px;
}

.timer .next-title {
    font-size: clamp(14px, 1.4vw, 22px);
    letter-spacing: 2px;
}

.timer h1 {
    font-size: clamp(14px, 1.5vw, 22px);
}

/* LEVEL & SCORE */
.level_box {
    padding-top: 12px;
    font-size: clamp(14px, 1.5vw, 22px);
    color: aqua;
}

/* =====================
   GAME CONTAINER
===================== */

.game-container {
    width: 33.3vw;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 40px;
}

/* =====================
   RIGHT CONTAINER
===================== */

.right-container {
    width: 33.3vw;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: flex-start;
    padding-top: 80px;

    /* 🔴 KRİTİK: içeriğin sığmasına izin ver */
    min-height: 0;
}

/* =====================
   NEXT HUD
===================== */

.next-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.next-title {
    font-size: clamp(14px, 1.4vw, 22px);
    letter-spacing: 2px;
    color: #ffffff;
}

#next-piece {
    width: clamp(90px, 12vw, 160px);
    aspect-ratio: 1 / 1;
    background-color: #111;
    border: 3px solid white;
}

/* =====================
   HOLD HUD
===================== */

.hold-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

#hold-piece {
    width: clamp(90px, 12vw, 160px);
    aspect-ratio: 1 / 1;
    background-color: #111;
    border: 3px solid white;
}

/* =====================
   SVG DECORATION (ASLA KESİLMEZ)
===================== */

.decor-svg {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    margin-top: 24px;
}

/* 🔴 ASIL ÇÖZÜM BURADA */
.decor-svg img {
    width: 100%;
    max-width: 500px;

    /* 🔥 yüksekliğe bağlı ölçek */
    max-height: 28vh;
    height: auto;

    object-fit: contain; /* 🔴 KESİLMEYİ ENGELLER */
    pointer-events: none;
}

/* =====================
   CANVAS (GENEL)
===================== */

canvas {
    background-color: #111;
    border: 3px solid white;
    display: block;
    max-width: 100%;
    max-height: 100%;
}

/* =====================
   MENU BREAKPOINT
===================== */

@media (max-width: 1100px) {
    .top-menu {
        flex-direction: column;
        align-items: flex-start;
    }

    .menu_box {
        padding: 6px 0;
    }
}

/* =====================
   MEDIUM SCREEN
===================== */

@media (max-width: 900px) {
    .left-container,
    .right-container {
        width: 25vw;
    }

    .game-container {
        width: 50vw;
    }

    .decor-svg img {
        max-height: 22vh; /* 🔴 daha da küçül */
    }
}

/* =====================
   SMALL SCREEN
===================== */

@media (max-width: 600px) {
    .left-container,
    .right-container {
        display: none;
    }

    .game-container {
        width: 100vw;
        padding-top: 0;
    }

    .decor-svg {
        display: none;
    }
}



/* ======= MODAL ======= */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.modal {
    position: relative;
    background: #0f1220;
    color: white;
    padding: 32px;
    width: min(90%, 420px);
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    animation: pop 0.25s ease-out;
}

@keyframes pop {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal h2 {
    margin-bottom: 12px;
}

.modal-desc {
    font-size: 0.9rem;
    opacity: 0.85;
    margin-bottom: 24px;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-links a {
    text-decoration: none;
    color: white;
    background: #1a1f3c;
    padding: 12px;
    border-radius: 8px;
    transition: background 0.2s;
}

.contact-links a:hover {
    background: #2a2f5c;
}

.close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
}

/* =====================
   START SCREEN
===================== */

.start-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.start-box {
    text-align: center;
    color: white;
}

.start-box h1 {
    font-size: clamp(32px, 6vw, 72px);
    letter-spacing: 6px;
    margin-bottom: 32px;
}

.start-box button {
    font-family: inherit;
    font-size: clamp(14px, 2vw, 20px);
    padding: 12px 32px;
    border: 2px solid white;
    background: transparent;
    color: white;
    cursor: pointer;
    transition: all 0.25s ease;
}

.start-box button:hover {
    background: white;
    color: #0f1220;
}

.start-box p {
    margin-top: 16px;
    font-size: 0.9rem;
    opacity: 0.75;
}

/* =====================
   START SCREEN TEXT
===================== */

.start-desc {
    margin-top: 12px;
    margin-bottom: 28px;
    font-size: clamp(12px, 1.2vw, 16px);
    line-height: 1.5;
    opacity: 0.8;
}

.start-hint {
    margin-top: 16px;
    font-size: 0.85rem;
    opacity: 0.7;
}


/* =====================
   PAUSE & GAME OVER
===================== */

.game-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.menu-box {
    text-align: center;
    color: white;
}

.menu-box h2 {
    font-size: clamp(28px, 4vw, 56px);
    letter-spacing: 4px;
    margin-bottom: 24px;
}

.menu-box p {
    font-size: clamp(14px, 1.5vw, 18px);
    opacity: 0.85;
    margin-bottom: 12px;
}

.menu-box button {
    font-family: inherit;
    display: block;
    margin: 12px auto;
    padding: 12px 36px;
    font-size: clamp(14px, 2vw, 18px);
    border: 2px solid white;
    background: transparent;
    color: white;
    cursor: pointer;
    transition: all 0.25s ease;
}

/* =====================
   PAUSE MENU BUTTON SIZE
===================== */

#pause-overlay .menu-box button {
    width: 220px;        /* 🔴 eşit ve uzun */
    max-width: 80vw;     /* 🔴 küçük ekran güvenliği */
}


.menu-box button:hover {
    background: white;
    color: #0f1220;
}
