* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a1a;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ─── BACKGROUND ─── */
.bg-layer {
    position: fixed;
    inset: 0;
    background: url('assets/Web-Arkaplan-1920x1080.png') center center / cover no-repeat;
    z-index: 0;
}

@media (max-width: 768px) {
    .bg-layer {
        background-image: url('assets/Mobil-Arkaplan-1080x1920.png');
    }
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1;
}

/* ─── WRAPPER ─── */
.game-wrapper {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 960px;
    max-height: 100vh;
    padding: 12px 16px;
}

/* ─── LOGO ─── */
.logo-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
}

.logo {
    width: clamp(70px, 10vw, 130px);
    height: clamp(70px, 10vw, 130px);
    object-fit: contain;
    filter: drop-shadow(0 0 16px rgba(255, 215, 0, 0.6));
}

/* ─── TABLE ─── */
.table-wrap {
    position: relative;
    width: 100%;
    max-width: 960px;
    /* Masanın en-boy oranını koru (2000x1000) */
    aspect-ratio: 2 / 1;
    max-height: 55vh;
}

.table-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.7));
}

/* ─── CUPS AREA ─── */
.cups-area {
    position: absolute;
    top: 0;
    left: 6%;
    right: 6%;
    height: 35%;
    display: flex;
    align-items: flex-end;
    justify-content: space-evenly;
    pointer-events: none;
}

.cup-slot {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
}

.cup-slot.selectable {
    pointer-events: all;
    cursor: pointer;
}

.cup-slot.selectable:hover .cup-img {
    filter: drop-shadow(0 0 14px rgba(255, 215, 0, 0.9)) brightness(1.15);
}

/* ─── CUP IMAGE ─── */
.cup-img {
    width: clamp(60px, 8.5vw, 115px);
    position: relative;
    z-index: 3;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                filter 0.3s ease;
    transform-origin: bottom center;
    pointer-events: none;
    -webkit-user-drag: none;
}

/* Kaldırma animasyonu - bardak yukarı kalkar */
.cup-slot.lifting .cup-img {
    transform: translateY(-120%) !important;
}

/* ─── FLOATING DIAMOND ─── */
#floatingDiamond {
    position: absolute;
    z-index: 2;
    width: clamp(40px, 6vw, 80px);
    height: clamp(40px, 6vw, 80px);
    display: none;           /* JS ile gösterilir */
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transform: translateX(-50%); /* yatay ortalama */
    opacity: 0;
    transition: opacity 0.3s ease;
}

#floatingDiamond.visible {
    display: flex;
    opacity: 1;
}

.diamond-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: float 1.4s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(0, 200, 255, 0.8));
    pointer-events: none;
    -webkit-user-drag: none;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-6px); }
}

/* ─── START BUTTON ─── */
.btn-wrap {
    margin-top: 6px;
}

.start-btn {
    background: linear-gradient(135deg, #f7c948, #e8a000);
    border: none;
    color: #1a0a00;
    font-size: clamp(14px, 2vw, 20px);
    font-weight: 800;
    letter-spacing: 2px;
    padding: 14px 44px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 24px rgba(247, 201, 72, 0.5), 0 0 0 3px rgba(247, 201, 72, 0.2);
    transition: transform 0.15s, box-shadow 0.15s;
    text-transform: uppercase;
}

.start-btn:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 8px 32px rgba(247, 201, 72, 0.7), 0 0 0 4px rgba(247, 201, 72, 0.3);
}

.start-btn:active {
    transform: scale(0.97);
}

.start-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

/* ─── MESSAGE BOX ─── */
.message-box {
    min-height: 30px;
    color: #fff;
    font-size: clamp(13px, 1.8vw, 18px);
    font-weight: 600;
    letter-spacing: 1px;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
    transition: opacity 0.4s;
}

/* ─── MODALS ─── */
.reward-modal,
.fail-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    animation: fadeIn 0.35s ease;
}

.reward-modal.hidden,
.fail-modal.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.reward-card,
.fail-card {
    background: linear-gradient(145deg, #1a1a3e, #0d0d25);
    border: 2px solid rgba(247, 201, 72, 0.5);
    border-radius: 24px;
    padding: 40px 50px;
    text-align: center;
    box-shadow: 0 0 60px rgba(247, 201, 72, 0.3), 0 20px 60px rgba(0,0,0,0.6);
    animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 380px;
    width: 90%;
}

.fail-card {
    border-color: rgba(255, 80, 80, 0.5);
    box-shadow: 0 0 60px rgba(255, 80, 80, 0.2), 0 20px 60px rgba(0,0,0,0.6);
}

@keyframes popIn {
    from { transform: scale(0.6); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

.reward-sparkles {
    font-size: 36px;
    animation: spin 2s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0%   { transform: rotate(0deg)   scale(1); }
    50%  { transform: rotate(180deg) scale(1.2); }
    100% { transform: rotate(360deg) scale(1); }
}

.reward-title {
    font-size: 28px;
    font-weight: 900;
    color: #f7c948;
    text-shadow: 0 0 20px rgba(247, 201, 72, 0.7);
    margin: 10px 0 6px;
    letter-spacing: 3px;
}

.reward-sub {
    color: #aaa;
    font-size: 14px;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.reward-amount {
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 30px rgba(0, 200, 255, 0.8), 0 0 60px rgba(0, 200, 255, 0.4);
    margin: 8px 0 24px;
    letter-spacing: 2px;
}

.fail-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.fail-title {
    font-size: 24px;
    font-weight: 800;
    color: #ff5050;
    text-shadow: 0 0 16px rgba(255, 80, 80, 0.5);
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.fail-sub {
    color: #bbb;
    font-size: 14px;
    margin-bottom: 24px;
}

.play-again-btn {
    background: linear-gradient(135deg, #f7c948, #e8a000);
    border: none;
    color: #1a0a00;
    font-size: 16px;
    font-weight: 800;
    padding: 12px 36px;
    border-radius: 50px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 16px rgba(247, 201, 72, 0.4);
}

.play-again-btn:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 8px 24px rgba(247, 201, 72, 0.6);
}

/* ─── CUP POSITION TRANSITION (for shuffle) ─── */
.cup-slot {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* Selected cup glow */
.cup-slot.selected .cup-img {
    filter: drop-shadow(0 0 18px rgba(255, 215, 0, 1)) brightness(1.2);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
    .cups-area {
        top: 40%;
        left: 2%;
        right: 2%;
        bottom: 8%;
    }
    .cup-img {
        width: clamp(44px, 11vw, 80px);
    }
    .diamond-wrap {
        width: clamp(28px, 7vw, 55px);
        height: clamp(28px, 7vw, 55px);
    }
}

@media (max-width: 480px) {
    .logo { width: 70px; height: 70px; }
    .reward-card, .fail-card { padding: 28px 24px; }
    .cups-area {
        top: 42%;
        left: 0%;
        right: 0%;
        bottom: 6%;
    }
    .cup-img {
        width: clamp(38px, 12vw, 65px);
    }
    .diamond-wrap {
        width: clamp(24px, 8vw, 45px);
        height: clamp(24px, 8vw, 45px);
    }
}
