/* 
 * papabo portfolio
 * handcrafted with love (and caffeine)
 */

:root {
    --bg: #0d0d0d;
    --bg-alt: #141414;
    --bg-card: #1a1a1a;
    --text: #e0e0e0;
    --text-dim: #808080;
    --text-muted: #555;
    --accent: #00ff9d;
    --accent-dim: rgba(0, 255, 157, 0.15);
    --red: #ff4757;
    --blue: #5865f2;
    --pink: #ff6b9d;
    --border: #2a2a2a;
    --mono: 'IBM Plex Mono', monospace;
    --sans: 'Pretendard', -apple-system, sans-serif;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Scanlines - subtle CRT effect */
.scanlines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.03) 0px,
        rgba(0, 0, 0, 0.03) 1px,
        transparent 1px,
        transparent 2px
    );
}

/* Noise texture */
.noise {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* Page wrapper */
.page-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.logo {
    font-family: var(--mono);
    font-size: 1.1rem;
    font-weight: 600;
}

.logo-bracket {
    color: var(--accent);
}

.logo-text {
    color: var(--text);
}

.nav {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--accent);
}

/* Main */
.main {
    flex: 1;
}

/* Hero Section */
.hero {
    margin-bottom: 4rem;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Terminal Box */
.terminal-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
}

.terminal-dots {
    display: flex;
    gap: 6px;
}

.terminal-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.terminal-dots span:nth-child(1) { background: #ff5f57; }
.terminal-dots span:nth-child(2) { background: #febc2e; }
.terminal-dots span:nth-child(3) { background: #28c840; }

.terminal-title {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.terminal-content {
    padding: 1rem;
    font-family: var(--mono);
    font-size: 0.8rem;
    line-height: 1.8;
}

.line {
    margin-bottom: 0.25rem;
}

.line.output {
    color: var(--text-dim);
    padding-left: 1rem;
    margin-bottom: 0.75rem;
}

.prompt {
    color: var(--accent);
    margin-right: 0.5rem;
}

.cmd {
    color: var(--text);
}

.dim {
    color: var(--text-muted);
}

.intro-text {
    line-height: 1.6;
}

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding-left: 1rem !important;
}

.tag {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: var(--accent-dim);
    border: 1px solid var(--accent);
    border-radius: 3px;
    font-size: 0.7rem;
    color: var(--accent);
}

.cursor {
    display: inline-block;
    animation: blink 1s step-end infinite;
}

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

/* Hero Text */
.hero-text {
    padding-top: 1rem;
}

.name {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    line-height: 1.1;
}

.char {
    display: inline-block;
    transition: transform 0.3s, color 0.3s;
}

.char:hover {
    color: var(--accent);
    transform: translateY(-4px);
}

.role {
    font-family: var(--mono);
    font-size: 0.9rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.desc {
    color: var(--text-dim);
    font-size: 0.95rem;
}

.desc strong {
    color: var(--text);
    font-weight: 500;
}

@media (max-width: 768px) {
    .name {
        font-size: 2.2rem;
    }
    
    .hero-text {
        padding-top: 0;
    }
}

/* Section Heading */
.section-heading {
    font-family: var(--mono);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Contact Section */
.contact-section {
    margin-bottom: 3rem;
}

.contact-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (max-width: 600px) {
    .contact-list {
        grid-template-columns: 1fr;
    }
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
}

.contact-item:hover {
    border-color: var(--accent);
    transform: translateX(4px);
}

.contact-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
}

.contact-icon svg {
    width: 18px;
    height: 18px;
}

.contact-icon.discord {
    background: rgba(88, 101, 242, 0.15);
    color: var(--blue);
}

.contact-icon.instagram {
    background: rgba(255, 107, 157, 0.15);
    color: var(--pink);
}

.contact-icon.phone {
    background: var(--accent-dim);
    color: var(--accent);
}

.contact-icon.email {
    background: rgba(255, 71, 87, 0.15);
    color: var(--red);
}

.contact-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.contact-label {
    font-family: var(--mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.contact-value {
    font-size: 0.85rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Challenge Section */
.challenge-section {
    margin-bottom: 3rem;
    text-align: center;
}

.challenge-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: transparent;
    border: 1px solid var(--red);
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 0.9rem;
    color: var(--red);
    cursor: pointer;
    transition: all 0.2s;
}

.challenge-btn:hover {
    background: var(--red);
    color: var(--bg);
}

.challenge-icon {
    font-weight: 600;
}

.challenge-hint {
    margin-top: 0.5rem;
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Game Section */
.game-section {
    margin-bottom: 3rem;
}

.nickname-setup {
    text-align: center;
    padding: 2rem;
}

.nickname-label {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
}

.nickname-form {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    max-width: 300px;
    margin: 0 auto;
}

.nickname-input {
    flex: 1;
    padding: 0.625rem 0.875rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--text);
}

.nickname-input:focus {
    outline: none;
    border-color: var(--accent);
}

.nickname-input::placeholder {
    color: var(--text-muted);
}

.nickname-btn {
    padding: 0.625rem 1rem;
    background: var(--accent);
    border: none;
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--bg);
    cursor: pointer;
    transition: opacity 0.2s;
}

.nickname-btn:hover {
    opacity: 0.9;
}

/* Game Area */
.game-area {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.game-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.hud-left {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.player-name {
    font-family: var(--mono);
    font-weight: 600;
    color: var(--accent);
}

.player-rank {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.hud-right {
    display: flex;
    gap: 1rem;
}

.hud-stat {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.stat-val {
    font-family: var(--mono);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
}

.stat-label {
    font-family: var(--mono);
    font-size: 0.65rem;
    color: var(--text-muted);
}

.hud-stat.time .stat-val {
    color: var(--red);
}

/* Game Wrapper */
.game-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/10;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1rem;
}

#game-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.game-overlay {
    position: absolute;
    inset: 0;
    background: rgba(13, 13, 13, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-overlay.hidden {
    display: none;
}

.game-start-screen {
    text-align: center;
    padding: 1.5rem;
}

.game-start-screen h3 {
    font-family: var(--mono);
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.game-rules {
    list-style: none;
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 1.5rem;
}

.game-rules li {
    margin-bottom: 0.25rem;
}

.game-rules li::before {
    content: '>';
    color: var(--accent);
    margin-right: 0.5rem;
}

.game-start-btn {
    padding: 0.75rem 2rem;
    background: var(--accent);
    border: none;
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--bg);
    cursor: pointer;
    transition: transform 0.2s;
}

.game-start-btn:hover {
    transform: scale(1.05);
}

/* Leaderboard */
.leaderboard {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem;
}

.lb-title {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.lb-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.lb-loading {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    padding: 0.5rem;
}

.lb-entry {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-alt);
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 0.8rem;
}

.lb-entry.me {
    border: 1px solid var(--accent);
}

.lb-rank {
    min-width: 24px;
    font-weight: 600;
}

.lb-rank.gold { color: #ffd700; }
.lb-rank.silver { color: #c0c0c0; }
.lb-rank.bronze { color: #cd7f32; }

.lb-name {
    flex: 1;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lb-score {
    color: var(--accent);
    font-weight: 500;
}

/* Footer */
.site-footer {
    padding: 1.5rem 0;
    margin-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.footer-secret {
    margin-top: 0.25rem;
    opacity: 0.3;
    transition: opacity 0.2s;
}

.footer-secret:hover {
    opacity: 1;
    color: var(--accent);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-box {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    animation: modalIn 0.2s ease;
}

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

.modal-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.875rem;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-dim);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.modal-close:hover {
    color: var(--red);
}

.modal-content {
    padding: 1.25rem;
}

/* Captcha Progress */
.captcha-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.progress-step {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border);
    border-radius: 50%;
    font-family: var(--mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s;
}

.progress-step.active {
    border-color: var(--accent);
    color: var(--accent);
}

.progress-step.completed {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
}

.progress-line {
    width: 24px;
    height: 2px;
    background: var(--border);
}

/* Captcha Challenges */
.captcha-challenges {
    margin-bottom: 1rem;
}

.captcha-challenge {
    display: none;
    text-align: center;
}

.captcha-challenge.active {
    display: block;
}

.challenge-title {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.challenge-code {
    display: block;
    padding: 0.875rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
    word-break: break-all;
}

.challenge-desc {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* Captcha Form */
.captcha-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.captcha-input {
    flex: 1;
    padding: 0.625rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--text);
}

.captcha-input:focus {
    outline: none;
    border-color: var(--accent);
}

.captcha-input::placeholder {
    color: var(--text-muted);
}

.captcha-btn {
    padding: 0.625rem 1rem;
    background: var(--accent);
    border: none;
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--bg);
    cursor: pointer;
}

.captcha-result {
    min-height: 20px;
    font-family: var(--mono);
    font-size: 0.8rem;
    text-align: center;
}

.captcha-result.error {
    color: var(--red);
}

.captcha-result.success {
    color: var(--accent);
}

.captcha-attempts {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0.75rem;
}

/* Success Modal */
.success-modal .success-box {
    width: 100%;
    max-width: 380px;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    animation: modalIn 0.2s ease;
}

.success-box h2 {
    font-family: var(--mono);
    font-size: 1.25rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.flag-box {
    padding: 1rem;
    background: var(--bg);
    border: 1px dashed var(--accent);
    border-radius: 4px;
    margin-bottom: 0.75rem;
}

.flag-box code {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--accent);
    word-break: break-all;
}

.success-box p {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 1rem;
}

.success-btn {
    padding: 0.625rem 1.5rem;
    background: var(--accent);
    border: none;
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--bg);
    cursor: pointer;
}

/* Game Over Modal */
.gameover-box {
    width: 100%;
    max-width: 320px;
    background: var(--bg-card);
    border: 1px solid var(--red);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    animation: modalIn 0.2s ease;
}

.gameover-box h2 {
    font-family: var(--mono);
    font-size: 1.25rem;
    color: var(--red);
    margin-bottom: 0.75rem;
}

.final-score {
    font-family: var(--mono);
    font-size: 3rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.final-rank {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 1.25rem;
}

.retry-btn {
    padding: 0.625rem 1.5rem;
    background: var(--red);
    border: none;
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
}

/* Confetti */
#confetti-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 10000;
}

/* Shake animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.shake {
    animation: shake 0.3s ease;
}

/* Selection */
::selection {
    background: var(--accent);
    color: var(--bg);
}

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

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Mobile adjustments */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .page-wrapper {
        padding: 1rem;
    }
    
    .site-header {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
    
    .nav {
        gap: 1rem;
    }
    
    .terminal-content {
        font-size: 0.75rem;
    }
    
    .tag {
        font-size: 0.65rem;
        padding: 0.15rem 0.4rem;
    }
    
    .contact-item {
        padding: 0.75rem;
    }
    
    .contact-icon {
        width: 32px;
        height: 32px;
    }
    
    .contact-icon svg {
        width: 16px;
        height: 16px;
    }
    
    .contact-value {
        font-size: 0.8rem;
    }
    
    .game-wrapper {
        aspect-ratio: 4/3;
    }
    
    .game-hud {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .hud-right {
        gap: 0.75rem;
    }
    
    .stat-val {
        font-size: 1rem;
    }
}

/* Leaderboard empty state */
.lb-empty {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    padding: 1rem;
}
