/* css/gameDiff.css */
/*
 * Stylesheet khusus untuk game "Spot The Different".
 * Didesain secara premium, konsisten dengan Whack-a-Mole dan Slide Puzzle.
 */

.game-diff-page {
    display: none;
    position: absolute;
    top: 90px;
    left: 0;
    width: 100%;
    height: calc(100% - 90px);
    background-color: #f7fafc;
    box-sizing: border-box;
    padding: 20px 40px;
    overflow: hidden;
}

.game-diff-page.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 1. Tampilan Pemilihan Level/Gambar */
.diff-select-view {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    box-sizing: border-box;
}

.diff-select-title {
    font-size: 36px;
    font-weight: 800;
    color: #2d3748;
    margin-bottom: 30px;
    text-align: center;
}

.diff-image-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    width: 100%;
    max-width: 1100px;
    margin: 40px auto;
}

.diff-image-card {
    border-radius: 20px;
    overflow: hidden;
    border: 4px solid transparent;
    cursor: pointer;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    aspect-ratio: 1.4;
    background-color: #ffffff;
    position: relative;
}

.diff-image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.diff-image-card .level-badge {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background-color: var(--ariston-red);
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
    padding: 8px 20px;
    border-radius: 25px;
    box-shadow: 0 4px 10px rgba(227, 28, 45, 0.3);
}

.diff-image-card.focused,
.diff-image-card:hover {
    transform: scale(1.05);
    border-color: var(--ariston-red);
    box-shadow: 0 20px 40px rgba(227, 28, 45, 0.25);
}

.diff-select-actions {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

/* 2. Tampilan Board Game Utama */
.diff-game-container {
    max-width: 1300px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: space-between;
    box-sizing: border-box;
}

/* Header Bar */
.diff-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 10px 0;
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
}

.diff-stat-box {
    background-color: #ffffff;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.06);
    padding: 12px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
    min-width: 120px;
}

.diff-stat-lbl {
    font-size: 12px;
    font-weight: 700;
    color: #a0aec0;
    letter-spacing: 1.5px;
    margin-bottom: 4px;
}

.diff-stat-val {
    font-size: 28px;
    font-weight: 800;
    color: var(--ariston-red);
}

.diff-title-wrapper {
    height: 70px;
    display: flex;
    align-items: center;
}

.diff-game-title-img {
    height: 100%;
    object-fit: contain;
}

/* Kontainer Dua Gambar Bersandingan */
.diff-images-board {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    width: 100%;
    flex: 1;
    margin: 20px 0;
    min-height: 0; /* Mengatasi overflow di flex */
    align-items: center;
}

.diff-image-panel {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border: 3px solid #e2e8f0;
    aspect-ratio: 1.5;
    background-color: #ffffff;
    width: 100%;
    height: 100%;
    max-height: 100%;
}

.diff-image-panel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.diff-image-panel .panel-tag {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 8px;
    letter-spacing: 0.5px;
    z-index: 10;
}

/* Pointer Crosshair Spasial (untuk Remote control) */
.diff-crosshair-pointer {
    position: absolute;
    width: 50px;
    height: 50px;
    border: 3px solid #ff1c2d;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(255, 28, 45, 0.7);
    pointer-events: none;
    z-index: 100;
    transform: translate(-50%, -50%);
    box-sizing: border-box;
    transition: left 0.15s ease-out, top 0.15s ease-out;
}

.diff-crosshair-pointer::before,
.diff-crosshair-pointer::after {
    content: '';
    position: absolute;
    background-color: #ff1c2d;
}

/* Horizontal crosshair line */
.diff-crosshair-pointer::before {
    top: 50%;
    left: -10px;
    right: -10px;
    height: 2px;
    transform: translateY(-50%);
}

/* Vertical crosshair line */
.diff-crosshair-pointer::after {
    left: 50%;
    top: -10px;
    bottom: -10px;
    width: 2px;
    transform: translateX(-50%);
}

/* Marker untuk perbedaan yang ditemukan */
.diff-marker {
    position: absolute;
    width: 60px;
    height: 60px;
    border: 4px solid #ff1c2d;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px rgba(255, 28, 45, 0.5);
    animation: markerPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    z-index: 20;
    pointer-events: none;
}

@keyframes markerPop {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.2); }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* Efek Flashing Merah Saat Klik/Salah */
.diff-images-board.wrong-click {
    animation: shakeBoard 0.4s ease-in-out;
}

@keyframes shakeBoard {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* Footer Actions */
.diff-footer-actions {
    width: 100%;
    display: flex;
    justify-content: center;
    padding-bottom: 15px;
}

/* Modal Pop-up */
.diff-overlay-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    z-index: 999;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.diff-overlay-modal.active {
    display: flex;
}

.diff-modal-content {
    background-color: #ffffff;
    border-radius: 24px;
    padding: 50px 60px;
    max-width: 650px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    transform: scale(0.9);
    animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.diff-modal-title {
    font-size: 38px;
    font-weight: 800;
    color: #1a202c;
    margin-bottom: 16px;
}

.diff-modal-desc {
    font-size: 18px;
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 30px;
}

.diff-score-summary {
    background-color: #fff5f5;
    border: 2px dashed rgba(227, 28, 45, 0.3);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 35px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.diff-summary-lbl {
    font-size: 14px;
    font-weight: 700;
    color: #718096;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.diff-summary-val {
    font-size: 48px;
    font-weight: 900;
    color: var(--ariston-red);
}

.diff-modal-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.diff-modal-buttons button {
    min-width: 180px;
}
