:root {
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-color: #1a1a1a;
    --accent-color: #3498db;
    --green-neon: #aaff00;
    --yellow-neon: #ffff00;
    --pink-neon: #ff00ff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    overflow-x: hidden;
    user-select: none;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-color);
}

.stats {
    font-size: 0.875rem;
    color: #666;
}

main {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    background: white;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.05);
    border-radius: 4px;
}

.words-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: left;
}

.word-row {
    display: flex;
    justify-content: center;
    margin-right: 0;
    transition: background 0.2s;
    border-radius: 4px;
    padding: 2px 1rem;
    width: 100%;
}

.word-row:hover {
    background: rgba(0,0,0,0.03);
}

.hooks-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1.5rem;
    font-size: 18px;
    font-weight: 400;
    width: 100%;
}

.hooks.left {
    justify-self: end;
}

.word {
    justify-self: center;
}

.hooks.right {
    justify-self: start;
}

.hooks {
    display: flex;
    gap: 0.1rem;
}

.letter {
    display: inline-block;
    position: relative;
    min-width: 0.8em;
    cursor: pointer;
    padding: 2px 1px;
    z-index: 1;
}

.word .letter {
    color: var(--text-color);
}

.left .letter, .right .letter {
    color: #999;
}

.letter.highlighted {
    color: #1a1a1a !important;
}

/* Highlight SVG (behind text) */
.underline-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    mix-blend-mode: multiply;
}

.underline-svg path {
    stroke-dasharray: 120;
    stroke-dashoffset: 120;
    animation: drawStroke 0.4s ease-out forwards;
}

@keyframes drawStroke {
    to {
        stroke-dashoffset: 0;
    }
}

.underline-svg.green path { stroke: var(--green-neon); }
.underline-svg.yellow path { stroke: var(--yellow-neon); }
.underline-svg.pink path { stroke: var(--pink-neon); }

/* Controls Footer */
.controls {
    margin-top: 1rem;
    padding: 1rem 0;
    position: sticky;
    bottom: 0;
    z-index: 1000;
    background: var(--bg-color);
}

.tool-palette {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    padding: 0.75rem;
    border-radius: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
}

.highlighters {
    display: flex;
    gap: 1rem;
}

.tool {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #f0f0f0;
    border: 1px solid #ddd;
}

.tool:hover {
    background: #e8e8e8;
}

.tool.active {
    background: #fff;
    border-color: #3498db;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
}

.tip {
    width: 24px;
    height: 14px;
    border-radius: 2px;
    transform: rotate(-25deg) skewX(-15deg);
    border-right: 3px solid rgba(0,0,0,0.2);
}

.green .tip { background: var(--green-neon); box-shadow: 0 0 10px var(--green-neon); }
.yellow .tip { background: var(--yellow-neon); box-shadow: 0 0 10px var(--yellow-neon); }
.pink .tip { background: var(--pink-neon); box-shadow: 0 0 10px var(--pink-neon); }
.eraser .tip { background: white; box-shadow: 0 0 5px white; }

.action-buttons {
    display: flex;
}

.action-btn {
    background: transparent;
    border: none;
    color: #666;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    transition: color 0.2s;
}

.action-btn:hover {
    color: var(--text-color);
}

.action-btn span {
    font-size: 0.7rem;
    font-weight: 600;
}

/* Navigation buttons */
.navigation {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-color);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.index-display {
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%) translateY(50px);
    background: var(--accent-color);
    color: var(--bg-color);
    padding: 0.75rem 1.5rem;
    border-radius: 1rem;
    font-weight: 700;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    pointer-events: none;
    z-index: 100;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.mt-8 { margin-top: 2rem; }

@media (max-width: 480px) {
    .hooks-container {
        font-size: 1rem;
    }
    main {
        padding: 1rem;
    }
}
