/* vibecoding.nu style variables */
:root {
    --primary-color: #8A2BE2;    /* Purple */
    --secondary-color: #FF1493;  /* Pink */
    --accent-color: #00FFFF;     /* Cyan */
    --bg-color: #121212;         /* Dark background */
    --text-color: #FFFFFF;       /* White text */
    --card-bg-color: rgba(255, 255, 255, 0.1); /* Semi-transparent card background */
    --transition-speed: 0.3s;    /* Standard transition speed */
    
    /* Keep some of the game-specific variables */
    --grid-bg: rgba(255, 255, 255, 0.05);
    --grid-border: rgba(255, 255, 255, 0.2);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    transition: background-color 0.5s ease;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

header {
    text-align: center;
    padding: 30px 0;
    animation: fadeIn 1s ease-in;
}

h1 {
    color: var(--primary-color);
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 10px rgba(138, 43, 226, 0.5);
}

h2, h3 {
    color: var(--accent-color);
    margin: 1rem 0;
}

.subtitle {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-top: 0;
}

/* Game container styling */
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    animation: fadeIn 1s ease-in;
}

.game-area {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

/* Board styling with vibecoding aesthetics */
.game-board {
    border: 2px solid var(--grid-border);
    background-color: var(--grid-bg);
    display: grid;
    grid-template-rows: repeat(20, 20px);
    grid-template-columns: repeat(10, 20px);
    gap: 1px;
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.3);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.game-board:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px rgba(138, 43, 226, 0.5);
}

.side-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.next-piece {
    border: 2px solid var(--grid-border);
    background-color: var(--grid-bg);
    display: grid;
    grid-template-rows: repeat(4, 20px);
    grid-template-columns: repeat(4, 20px);
    gap: 1px;
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.3);
}

/* Card-style elements */
.stats, .controls {
    background-color: var(--card-bg-color);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.3);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    margin-bottom: 20px;
}

.stats:hover, .controls:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px rgba(138, 43, 226, 0.5);
}

.stat-item {
    margin-bottom: 10px;
}

.stat-label {
    font-weight: bold;
    color: var(--accent-color);
}

.control-title {
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--accent-color);
}

.control-list {
    display: grid;
    grid-template-columns: auto auto;
    gap: 8px;
}

.key {
    display: inline-block;
    padding: 3px 8px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-family: monospace;
    box-shadow: 0 0 5px rgba(138, 43, 226, 0.3);
}

.cell {
    width: 20px;
    height: 20px;
    box-sizing: border-box;
}

/* Keep the Office supply colors but make them more vibrant */
.empty {
    background-color: var(--grid-bg);
}

.stapler {
    background-color: #ff5252;
    box-shadow: 0 0 5px #ff5252;
}

.paperclip {
    background-color: #40c4ff;
    box-shadow: 0 0 5px #40c4ff;
}

.folder {
    background-color: #ffeb3b;
    box-shadow: 0 0 5px #ffeb3b;
}

.pen {
    background-color: #69f0ae;
    box-shadow: 0 0 5px #69f0ae;
}

.notebook {
    background-color: #b388ff;
    box-shadow: 0 0 5px #b388ff;
}

.tape {
    background-color: #64ffda;
    box-shadow: 0 0 5px #64ffda;
}

.postit {
    background-color: #ffc107;
    box-shadow: 0 0 5px #ffc107;
}

/* Vibecoding button style */
button {
    display: inline-block;
    padding: 15px 30px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.2rem;
    transition: all var(--transition-speed);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.5);
    z-index: 1;
    border: none;
    cursor: pointer;
}

button:hover, button:focus {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(138, 43, 226, 0.8);
    outline: none;
}

button::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 10%, transparent 40%);
    opacity: 0;
    transform: scale(0.1);
    transition: all 0.5s;
    z-index: -1;
}

button:hover::before, button:focus::before {
    opacity: 0.5;
    transform: scale(1);
}

/* Game over modal with vibecoding style */
.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    color: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    z-index: 100;
    display: none;
    box-shadow: 0 0 30px rgba(138, 43, 226, 0.7);
    border: 1px solid var(--primary-color);
}

.game-over h2 {
    margin-top: 0;
    color: var(--secondary-color);
}

/* Footer styling */
footer {
    margin-top: auto;
    padding: 20px;
    text-align: center;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

footer a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color var(--transition-speed);
}

footer a:hover {
    color: var(--secondary-color);
}

/* Background animation */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.bg-animation span {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-color), 0 0 20px var(--accent-color);
    animation: animate 5s linear infinite;
    will-change: transform;
}

.bg-animation span:nth-child(even) {
    background: var(--secondary-color);
    box-shadow: 0 0 10px var(--secondary-color), 0 0 20px var(--secondary-color);
}

/* Menu toggle */
.menu-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.5);
    z-index: 200;
    transition: all var(--transition-speed);
}

.menu-toggle:hover, .menu-toggle:focus {
    transform: scale(1.1);
    outline: none;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 3px 0;
    transition: all var(--transition-speed);
}

.menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile menu */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 100;
    padding: 80px 20px 20px 20px;
    transition: right var(--transition-speed) ease;
    backdrop-filter: blur(10px);
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

.mobile-menu.active {
    right: 0;
}

.menu-links {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.menu-links a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    padding: 10px;
    border-radius: 8px;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
}

.menu-links a:hover, .menu-links a:focus {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
    outline: none;
}

.menu-links a::before {
    content: '(';
    margin-right: 10px;
    opacity: 0.8;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes sparkle {
    0% { transform: scale(0) rotate(0deg); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: scale(1) rotate(180deg); opacity: 0; }
}

@keyframes animate {
    0% {
        transform: translateY(100vh) scale(0);
    }
    100% {
        transform: translateY(-100vh) scale(1);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .game-area {
        flex-direction: column;
    }
    
    .game-board {
        order: 2;
    }
    
    .side-panel {
        order: 1;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    button {
        animation: float 3s ease-in-out infinite;
        margin: 10px;
        padding: 12px 24px;
    }
}

/* Accessibility focus styles */
*:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 3px;
}

/* Skip to content link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    z-index: 1000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Prefers reduced motion media query */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .bg-animation span {
        animation: none !important;
    }
}