@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;600&display=swap');

:root {
    --bg-color: #1e1e1e;
    --text-color: #d4d4d4;
    --primary: #569cd6;
    --secondary: #4ec9b0;
    --accent: #ce9178;
    --error: #f44336;
    --success: #4caf50;
    
    --mine-bg: rgba(64, 166, 255, 0.2);
    --mine-border: #40a6ff;
    --theirs-bg: rgba(76, 175, 80, 0.2);
    --theirs-border: #4caf50;
    --marker-bg: rgba(128, 128, 128, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Fira Code', monospace;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
}

#app {
    width: 100%;
    max-width: 800px;
    height: 100%;
    position: relative;
    padding: 20px;
}

.screen {
    display: none;
    flex-direction: column;
    height: 100%;
    animation: fadeIn 0.3s;
}

.screen.active {
    display: flex;
}

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

h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--secondary);
}

.blink {
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.cmd-btn {
    background: transparent;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    padding: 10px 20px;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 4px;
    margin-top: 15px;
    transition: all 0.2s;
    text-align: left;
}

.cmd-btn::before {
    content: "$ ";
    color: var(--primary);
}

.cmd-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

header {
    display: flex;
    justify-content: space-between;
    padding-bottom: 15px;
    border-bottom: 1px solid #333;
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 1.2rem;
}

.stat { color: var(--accent); }
.stat span { color: var(--text-color); }

.context-panel {
    background: #252526;
    padding: 15px;
    border-left: 4px solid var(--secondary);
    margin-bottom: 20px;
    border-radius: 4px;
}

.conflict-editor {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 6px;
    overflow: hidden;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.file-name {
    background: #2d2d2d;
    padding: 8px 15px;
    font-size: 0.9rem;
    color: #9cdcfe;
    border-bottom: 1px solid #333;
}

#editor-lines {
    padding: 10px;
    overflow-y: auto;
    font-size: 0.95rem;
    line-height: 1.5;
    flex-grow: 1;
}

.line {
    display: flex;
    white-space: pre-wrap;
    padding: 2px 5px;
}

.line.marker {
    background: var(--marker-bg);
    color: #999;
    font-weight: bold;
}

.line.mine {
    background: var(--mine-bg);
    border-left: 3px solid var(--mine-border);
}

.line.theirs {
    background: var(--theirs-bg);
    border-left: 3px solid var(--theirs-border);
}

.resolution-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.resolve-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    color: #fff;
    transition: opacity 0.2s;
}

.resolve-btn:hover { opacity: 0.8; }

.resolve-btn.mine { background: #007acc; }
.resolve-btn.theirs { background: #388e3c; }
.resolve-btn.both { background: #d32f2f; }
.resolve-btn.manual { background: #f57c00; }

#manual-edit-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

textarea {
    width: 100%;
    flex-grow: 1;
    background: #1e1e1e;
    color: var(--text-color);
    border: 1px solid #333;
    padding: 10px;
    font-size: 1rem;
    line-height: 1.5;
    resize: none;
    outline: none;
    margin-bottom: 10px;
}

textarea:focus { border-color: var(--primary); }

.hidden { display: none !important; }

/* Leaderboard */
#leaderboard {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: #1e1e1e;
    border: 1px solid #333;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 1000;
    min-width: 320px;
}

.gold { color: #ffd700; text-align: center; margin-bottom: 20px; }

#scoreList div {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #333;
}

.stats-display {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dotted #555;
    font-size: 0.85rem;
    color: #aaa;
    line-height: 1.4;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

input[type="text"] {
    background: #2d2d2d;
    border: 1px solid #444;
    color: #fff;
    padding: 10px;
    outline: none;
    flex: 1;
}

.error { color: var(--error); }
