/* ============================================
   AR Shikaku Patches — Glassmorphism Design
   ============================================ */

:root {
    --arsp-bg: #0f0c29;
    --arsp-glass: rgba(255, 255, 255, 0.08);
    --arsp-glass-border: rgba(255, 255, 255, 0.15);
    --arsp-accent: #ff6b6b;
    --arsp-secondary: #4ecdc4;
    --arsp-text: #ffffff;
    --arsp-font: 'Inter', sans-serif;
}

.arsp-container {
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    color: var(--arsp-text);
    font-family: var(--arsp-font);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    overflow-x: hidden;
}

.arsp-screen {
    display: none;
    width: 100%;
    max-width: 500px;
    flex-direction: column;
    animation: arspFadeIn 0.4s ease-out;
}

.arsp-screen--active {
    display: flex;
}

@keyframes arspFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header */
.arsp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    background: var(--arsp-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 15px 20px;
    border-radius: 20px;
    border: 1px solid var(--arsp-glass-border);
}

.arsp-title-area h1 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(to right, #fff, #ccc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.arsp-title-area span {
    font-size: 0.8rem;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Canvas Area */
.arsp-game-canvas-container {
    background: var(--arsp-glass);
    backdrop-filter: blur(15px);
    border-radius: 24px;
    border: 1px solid var(--arsp-glass-border);
    padding: 10px;
    margin-bottom: 25px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    aspect-ratio: 1/1;
    display: flex;
    justify-content: center;
    align-items: center;
}

#arsp-canvas {
    width: 100%;
    height: 100%;
    touch-action: none; /* Crucial for drag */
    cursor: crosshair;
}

/* Controls */
.arsp-controls {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    width: 100%;
}

.arsp-btn {
    padding: 14px 10px;
    border-radius: 16px;
    border: none;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: white;
}

.arsp-btn:active { transform: scale(0.95); }

.arsp-btn--primary {
    background: linear-gradient(45deg, #ff416c, #ff4b2b);
    box-shadow: 0 8px 15px rgba(255, 65, 108, 0.3);
}

.arsp-btn--secondary {
    background: var(--arsp-glass);
    border: 1px solid var(--arsp-glass-border);
}

.arsp-btn--accent {
    background: linear-gradient(45deg, #00b4db, #0083b0);
    box-shadow: 0 8px 15px rgba(0, 180, 219, 0.3);
}

.arsp-icon-btn {
    background: var(--arsp-glass);
    border: 1px solid var(--arsp-glass-border);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
}

.arsp-instructions-box {
    margin-top: 20px;
    background: rgba(255,255,255,0.05);
    padding: 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    text-align: center;
    opacity: 0.8;
}

/* Level Grid */
.arsp-level-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    padding: 10px;
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 5px;
}

.arsp-level-grid::-webkit-scrollbar { width: 6px; }
.arsp-level-grid::-webkit-scrollbar-thumb { background: var(--arsp-glass-border); border-radius: 10px; }

.arsp-level-btn {
    aspect-ratio: 1/1;
    border-radius: 12px;
    border: 1px solid var(--arsp-glass-border);
    background: var(--arsp-glass);
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.arsp-level-btn--completed {
    background: linear-gradient(45deg, #1d976c, #93f9b9);
    color: #004d40;
    border: none;
}

.arsp-level-btn--current {
    border: 2px solid #ffeb3b;
    box-shadow: 0 0 15px rgba(255,235,59,0.3);
}

.arsp-level-btn--locked {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(0,0,0,0.2);
}

/* Modals */
.arsp-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    align-items: center; justify-content: center;
    padding: 20px;
}

.arsp-modal--active { display: flex; }

.arsp-modal-content {
    background: #1a1a2e;
    border: 1px solid var(--arsp-glass-border);
    border-radius: 32px;
    padding: 40px 30px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    animation: arspPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes arspPop {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.win-icon { font-size: 4rem; margin-bottom: 20px; }
.arsp-modal-btns { display: flex; flex-direction: column; gap: 12px; margin-top: 30px; }

.arsp-howto-list { text-align: left; margin: 20px 0; padding-left: 20px; font-size: 0.95rem; line-height: 1.6; }

/* Responsive adjustments */
@media (max-width: 400px) {
    .arsp-level-grid { grid-template-columns: repeat(4, 1fr); }
    .arsp-controls { grid-template-columns: 1fr; }
    .arsp-header { padding: 10px 15px; }
}
