/* PAITO ADVANCED STYLE (V4.0 - WIDE SCREEN EDITION) */
:root {
    --cell-size: 34px; /* Ukuran Kotak (Pas untuk jari) */
    --bg-angka: #ffffff;
    --border-color: #cbd5e1;
}

/* 1. LAYOUT HALAMAN (FORCE FULL WIDTH) */
#page-paito {
    /* Paksa ambil seluruh lebar layar yang tersedia */
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #e2e8f0;
    min-height: 100vh;
}

/* Container Utama Paito (Override Glass Panel Standar) */
#page-paito .glass-panel {
    width: 100% !important;
    max-width: 100% !important; /* Jebol batas lebar */
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important; /* Kotak penuh tanpa sudut tumpul */
    border: none !important;
    background: #f1f5f9; /* Background terang bersih */
    box-shadow: none;
}

/* 2. HEADER & JUDUL (Dibuat Rapi di Atas) */
.paito-header-area {
    background: #1e293b;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #0f172a;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* 3. CONTROL PANEL (STICKY DI ATAS) */
.paito-controls {
    background: #334155;
    padding: 8px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #475569;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Palette Warna */
.color-palette {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 5px;
    margin-bottom: 8px;
    /* Sembunyikan scrollbar palette agar rapi */
    scrollbar-width: none; 
}
.color-palette::-webkit-scrollbar { display: none; }

.c-btn {
    width: 32px; height: 32px;
    border-radius: 4px;
    border: 2px solid #fff;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 2px 3px rgba(0,0,0,0.3);
}
.c-btn.active {
    transform: scale(1.15);
    border-color: #0f172a;
    z-index: 2;
    box-shadow: 0 0 0 2px white;
}

/* Input Posisi (Lebih Kompak) */
.pos-input-group {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-bottom: 5px;
}
.pos-input {
    width: 100%;
    background: #1e293b;
    border: 1px solid #475569;
    color: #e2e8f0;
    text-align: center;
    padding: 6px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.85rem;
}
.pos-input:focus {
    border-color: cyan;
    background: #0f172a;
    outline: none;
}

/* 4. GRID PAITO AREA (INTI TAMPILAN) */
.paito-wrapper {
    position: relative;
    background: #94a3b8; /* Warna sela-sela tabel */
    padding: 1px; /* Gap tipis */
    overflow-x: auto; /* Scroll Horizontal Aktif */
    -webkit-overflow-scrolling: touch; /* Smooth scroll di HP */
    min-height: 60vh;
}

/* TABEL PRESISI */
.paito-table {
    border-collapse: separate;
    border-spacing: 1px; /* Jarak antar kotak 1px biar tegas */
    table-layout: fixed;
    width: auto; /* Lebar mengikuti konten */
    margin: 0 auto; /* Tengah jika layar lebar */
    background: #94a3b8; 
}

/* Header Hari */
.paito-table th {
    background: #1e293b;
    color: #f8fafc;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 10px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: sticky; /* Header ikut turun kalau ada scroll vertikal */
    top: 0; 
}

/* CELL ANGKA (KOTAK PERSEGI) */
.paito-table td {
    width: var(--cell-size);
    height: var(--cell-size);
    padding: 0;
    text-align: center;
    vertical-align: middle;
    
    font-family: 'Roboto Mono', monospace; /* Font teknikal */
    font-weight: 700;
    font-size: 15px;
    
    color: #0f172a;
    background: var(--bg-angka);
    cursor: pointer;
    position: relative;
    z-index: 2;
}

/* Garis Pemisah Tebal Antar Hari */
.col-border-right {
    border-right: 4px solid #64748b !important;
}
/* Garis Bawah Mingguan (Opsional) */
.col-border-bottom {
    border-bottom: 4px solid #64748b !important;
}

/* Efek Warna Cell */
.paito-cell.colored { 
    color: white !important; 
    text-shadow: 1px 1px 0 rgba(0,0,0,0.4);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
}

/* 5. SVG LINES & TOOLS */
#paito-svg-layer {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none; z-index: 5; /* Di atas cell */
}
line {
    stroke-width: 3;
    stroke-linecap: round;
    opacity: 0.85;
    mix-blend-mode: multiply;
}

/* Tombol Bawah */
.btn-line-mode {
    background: #e2e8f0; color: #334155;
    border: 1px solid #cbd5e1;
    width: 95%; margin: 10px auto; padding: 10px;
    border-radius: 6px;
    font-weight: bold; font-size: 0.8rem;
    display: flex; align-items: center; justify-content: center; gap: 5px;
}
.btn-line-mode.active {
    background: #fdf2f8; color: #db2777;
    border-color: #fbcfe8;
    box-shadow: 0 0 0 2px #fbcfe8;
}

.adv-panel {
    background:#1e293b; 
    padding:10px; 
    margin: 10px;
    border-radius:8px; 
    border:1px solid #6366f1; 
    display:none; 
}

/* Tombol Kembali yang Lebar */
.btn-back-wide {
    width: 95%;
    margin: 20px auto;
    display: block;
    background: #0f172a;
    padding: 12px;
}