* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, sans-serif;
}

body {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
    color: #fff;
    padding: 20px;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
    padding: 40px 20px;
}

h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.2em;
    margin-bottom: 40px;
    opacity: 0.9;
}

.mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.mode-card {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 15px;
    padding: 30px 20px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.mode-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.mode-icon {
    font-size: 4em;
    margin-bottom: 15px;
}

.mode-card h2 {
    font-size: 1.4em;
    margin-bottom: 10px;
}

.mode-card p {
    opacity: 0.85;
    margin-bottom: 20px;
    min-height: 40px;
}

button {
    background: #f39c12;
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    margin: 5px;
    transition: background 0.2s, transform 0.1s;
}

button:hover {
    background: #e67e22;
    transform: scale(1.05);
}

button.secondary {
    background: rgba(255,255,255,0.2);
}

button.secondary:hover {
    background: rgba(255,255,255,0.3);
}

.difficulty-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
}

.difficulty-buttons button {
    padding: 8px 15px;
    font-size: 0.9em;
}

input[type="text"] {
    padding: 12px 20px;
    border-radius: 8px;
    border: 2px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 1.1em;
    width: 300px;
    max-width: 90%;
    margin: 10px;
    text-align: center;
}

input[type="text"]::placeholder {
    color: rgba(255,255,255,0.6);
}

.link-back {
    color: #f39c12;
    text-decoration: none;
    font-weight: bold;
}

.link-back:hover {
    text-decoration: underline;
}

/* Game page */
.game-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 30px;
    max-width: 1200px;
    margin: 20px auto;
}

.sidebar {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    min-width: 280px;
    border: 1px solid rgba(255,255,255,0.2);
}

.sidebar h2 {
    margin-bottom: 15px;
}

.status {
    font-size: 1.2em;
    padding: 15px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    margin: 15px 0;
    font-weight: bold;
}

.room-info {
    background: rgba(0,0,0,0.2);
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    text-align: left;
    font-size: 0.95em;
}

.room-info p {
    margin: 5px 0;
}

.btn-back, .btn-reset {
    display: block;
    width: 100%;
    margin-top: 10px;
}

.btn-reset {
    background: #e74c3c;
}

.btn-reset:hover {
    background: #c0392b;
}

.board-wrapper {
    background: rgba(0,0,0,0.3);
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

@media (max-width: 768px) {
    #board {
        width: 95vw !important;
        max-width: 560px;
    }
    .game-container {
        flex-direction: column;
        align-items: center;
    }
    .sidebar {
        width: 95%;
    }
}
/* Cegah layar ikut ke-scroll saat drag bidak catur di HP */
#board,
.board-b72b1,
.square-55d63,
.piece-417db {
    touch-action: none;
}


/* Perlindungan aset bidak: mencegah aksi simpan/seret standar browser.
   Ini mengurangi pengunduhan biasa; aset yang tampil di browser tetap tidak
   mungkin dibuat sepenuhnya rahasia dari pengguna yang memiliki DevTools. */
#board,
#board * {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

#board img,
#board .piece-417db {
    -webkit-user-drag: none;
    user-drag: none;
    user-select: none;
}

#board {
    -webkit-touch-callout: none;
}
