:root {
    --waffle-bg: #ffffff;
    --waffle-board-bg: #f0f2f5;
    --waffle-tile-border: #e5e7eb;
    --waffle-green: #6aaa64; /* Wordle/Waffle Standard Green */
    --waffle-yellow: #c9b458; /* Wordle/Waffle Standard Yellow */
    --waffle-gray: #787c7e;   /* Wordle/Waffle Standard Gray */
    --waffle-text: #1a1a1b;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Page Background Accent */
body {
    background-color: #f8f9fa;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.03) 0%, transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.03) 0%, transparent 25%);
}

/* Main Container Card */
.waffle-container {
    background-color: var(--waffle-bg);
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(0,0,0,0.03);
    position: relative;
    overflow: hidden;
}

/* Decorative background blur behind grid */
.waffle-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99,102,241,0.03) 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
}

/* Grid Wrapper - The "Board" Look */
.waffle-grid-wrapper {
    background-color: var(--waffle-board-bg);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
    display: inline-block;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.waffle-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 8px;
    max-width: 350px;
    margin: 0 auto;
    aspect-ratio: 1;
}

/* Tile Styling */
.waffle-tile {
    position: relative;
    width: 100%;
    height: 100%;
    aspect-ratio: 1;
    background-color: white; 
    border: 2px solid var(--waffle-tile-border);
    border-radius: 8px; /* Slightly less rounded for crisp look */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--waffle-text);
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    user-select: none;
}

/* Input styling */
.waffle-input {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 1.75rem;
    font-weight: 800;
    color: inherit;
    padding: 0;
    margin: 0;
    text-transform: uppercase;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    caret-color: transparent; /* Hide cursor to look more like a game tile */
}

.waffle-input::selection {
    background: transparent;
}

/* Color States */
.waffle-tile.green {
    background-color: var(--waffle-green);
    border-color: var(--waffle-green);
    color: white;
}

.waffle-tile.yellow {
    background-color: var(--waffle-yellow);
    border-color: var(--waffle-yellow);
    color: white;
}

.waffle-tile.gray {
    background-color: var(--waffle-gray);
    border-color: var(--waffle-gray);
    color: white;
}

.waffle-tile.empty-space {
    background: transparent;
    border-color: transparent;
    pointer-events: none;
}

/* Active/Focus State */
.waffle-tile:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
}

/* Hover Effects */
.waffle-tile:not(.empty-space):hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    z-index: 2;
}

/* Info Cards */
.info-card {
    background: white;
    border-radius: 20px;
    border: 0;
    box-shadow: var(--shadow-md);
}

.step-item {
    text-align: center;
    padding: 1.5rem;
    height: 100%;
    background: #fff;
    border-radius: 16px;
    transition: transform 0.2s ease;
}

.step-item:hover {
    transform: translateY(-5px);
}

.step-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary-color);
    margin: 0 auto 1.25rem;
    box-shadow: var(--shadow-sm);
}

/* Legend */
.legend-box {
    background: #f8fafc;
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
}

.legend-tile-preview {
    width: 42px;
    height: 42px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: var(--shadow-sm);
}

/* Result Section */
.result-card {
    border: 0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.result-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 1rem;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.result-body {
    background: #f0fdf4;
    padding: 2rem;
}

/* Buttons */
#solveBtn {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: none;
    transition: all 0.2s ease;
}
#solveBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Responsive */
@media (max-width: 500px) {
    .waffle-container {
        padding: 1.5rem;
    }
    .waffle-grid-wrapper {
        padding: 1rem;
    }
    .waffle-grid {
        gap: 4px;
    }
    .waffle-tile {
        border-radius: 4px;
        font-size: 1.25rem;
        border-width: 1px;
    }
    .waffle-input {
        font-size: 1.25rem;
    }
    .legend-tile-preview {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
}