@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --gold: #D4AF37;
    --gold-light: #F9DF74;
    --gold-dark: #A07E25;
    --lapis: #26619C;
    --papyrus: #F2E8C9;
    --sand: #E3C388;
    --cyber-blue: #4CC9F0;
    --cyber-pink: #F72585;
    --cyber-purple: #7209B7;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #000;
    color: #fff;
    overflow: hidden;
}

.font-geist-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    letter-spacing: -0.03em;
}

/* Puzzle board and container styles */
#puzzle-board {
    background-color: rgba(15, 15, 15, 0.8);
    background-image: 
        linear-gradient(rgba(212, 175, 55, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(212, 175, 55, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
}

#puzzle-container {
    cursor: grab;
}

#puzzle-container.grabbing {
    cursor: grabbing;
}

#puzzle-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 2px;
    padding: 20px;
    width: 100%;
    height: 100%;
}

.grid-cell {
    border: 1px dashed rgba(212, 175, 55, 0.1);
    border-radius: 4px;
}

/* Puzzle piece styles */
.puzzle-piece {
    position: absolute;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.puzzle-piece.available {
    cursor: grab;
    transition: transform 0.2s ease;
    box-shadow: 0 0 5px rgba(212, 175, 55, 0.3);
}

.puzzle-piece.available:hover {
    transform: scale(1.05);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
}

.puzzle-piece.dragging {
    cursor: grabbing;
    z-index: 100;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
    filter: brightness(1.2);
}

.puzzle-piece.placed {
    z-index: 10;
}

.puzzle-piece.connected {
    filter: brightness(1.1);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
}

.puzzle-edge {
    position: absolute;
    background-color: rgba(212, 175, 55, 0.4);
    transition: background-color 0.3s ease;
}

.puzzle-edge.top, .puzzle-edge.bottom {
    height: 10px;
    width: 30%;
    left: 50%;
    transform: translateX(-50%);
}

.puzzle-edge.left, .puzzle-edge.right {
    width: 10px;
    height: 30%;
    top: 50%;
    transform: translateY(-50%);
}

.puzzle-edge.top {
    top: -5px;
}

.puzzle-edge.right {
    right: -5px;
}

.puzzle-edge.bottom {
    bottom: -5px;
}

.puzzle-edge.left {
    left: -5px;
}

.puzzle-edge.connector {
    background-color: var(--gold);
    box-shadow: 0 0 5px var(--gold);
}

/* Connection line styles */
.connection-line {
    stroke: var(--gold);
    stroke-width: 2;
    stroke-dasharray: 5, 5;
    opacity: 0.6;
    animation: flow 1s linear infinite;
}

@keyframes flow {
    to {
        stroke-dashoffset: -10;
    }
}

/* Particle styles */
.particle {
    position: absolute;
    background-color: var(--gold);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
}

/* Animations */
@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(212, 175, 55, 0.3); }
    50% { box-shadow: 0 0 15px rgba(212, 175, 55, 0.5); }
    100% { box-shadow: 0 0 5px rgba(212, 175, 55, 0.3); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.glow {
    animation: glow 2s infinite;
}

.pulse {
    animation: pulse 2s infinite;
}

/* Scrollbar styles */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.3);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.5);
}

/* Tooltip */
.tooltip {
    position: absolute;
    background-color: rgba(20, 20, 20, 0.9);
    border: 1px solid var(--gold);
    color: white;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 1000;
    pointer-events: none;
    max-width: 180px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .puzzle-piece {
        transform-origin: center;
        transform: scale(0.8);
    }
}
