.app-window {
    position: absolute;
    z-index: 10;
    border-radius: var(--window-radius);
    overflow: hidden;
    width: 760px;
    height: 560px;
    background: rgba(255, 255, 255, var(--window-opacity));
    border: 1px solid rgba(255, 255, 255, 0.36);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.26);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    color: var(--ink);
}

.app-window.is-launching {
    animation: windowLaunch 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.app-window.is-maximized {
    inset: 12px 12px 92px !important;
    width: auto !important;
    height: auto !important;
    border-radius: calc(var(--window-radius) - 8px);
}

.window-chrome {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(241, 245, 249, 0.74));
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.window-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.window-title {
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.window-controls {
    display: flex;
    gap: 8px;
}

.window-controls button {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    padding: 0;
}

.window-controls button[data-action="minimize"] { background: #f59e0b; }
.window-controls button[data-action="maximize"] { background: #10b981; }
.window-controls button[data-action="close"] { background: #ef4444; }

.window-body {
    height: calc(100% - 62px);
    overflow: auto;
    padding: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(241, 245, 249, 0.76));
}

.window-body p,
.window-body li,
.window-body span,
.window-body strong,
.window-body h2,
.window-body h3,
.window-body h4 {
    color: var(--ink);
}

.hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.8fr);
    gap: 18px;
    margin-bottom: 18px;
}

.content-grid,
.skills-grid,
.credentials-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }

.feature-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 10px;
}

.stack-list {
    display: grid;
    gap: 14px;
}

.stack-list strong {
    display: block;
    margin-bottom: 4px;
}

.timeline {
    display: grid;
    gap: 18px;
    padding-left: 14px;
    border-left: 2px solid rgba(var(--accent-rgb), 0.18);
}

.timeline-item {
    position: relative;
    padding-left: 20px;
}

.timeline-item::before {
    content: "";
    position: absolute;
    top: 8px;
    left: -23px;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: rgba(var(--accent-rgb), 1);
    box-shadow: 0 0 0 6px rgba(var(--accent-rgb), 0.12);
}

.timeline-item h4,
.project-card h4,
.content-card h3 {
    margin: 0 0 8px;
}

.timeline-item p,
.project-card p,
.content-card p,
blockquote {
    margin: 0;
    line-height: 1.7;
}

.project-grid,
.contact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.project-tag,
.contact-label {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 0.78rem;
    font-weight: 700;
    color: rgba(var(--accent-rgb), 1);
}

.notepad-shell {
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 12px;
}

.toolbar,
.status-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toolbar-spacer {
    flex: 1;
}

.toolbar button,
.game-actions button,
.inline-actions button,
.upload-button {
    min-width: 110px;
}

#notepad-editor {
    width: 100%;
    min-height: 0;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 20px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--ink);
    resize: none;
    line-height: 1.7;
    font-family: var(--mono-font);
}

.status-bar {
    justify-content: space-between;
    color: var(--muted-ink);
    font-size: 0.84rem;
}

.tab-strip {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.tab-button {
    min-height: 40px;
    padding: 0 18px;
    border-radius: 14px;
}

.tab-button.is-active {
    background: rgba(var(--accent-rgb), 0.14);
    border-color: rgba(var(--accent-rgb), 0.2);
    color: rgba(var(--accent-rgb), 1);
}

.tab-panel {
    display: none;
}

.tab-panel.is-active {
    display: block;
}

.game-metrics {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    color: var(--muted-ink);
}

.game-board {
    margin-top: 16px;
}

.minesweeper-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 6px;
    max-width: 372px;
}

.mine-cell {
    aspect-ratio: 1;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    font-weight: 800;
}

.mine-cell.revealed {
    background: rgba(226, 232, 240, 0.8);
}

.mine-cell.mine {
    background: rgba(239, 68, 68, 0.15);
    color: #b91c1c;
}

.mine-cell.flagged {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.memory-card {
    aspect-ratio: 1;
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.9), rgba(15, 23, 42, 0.86));
    color: #f8fafc;
    font-weight: 800;
    font-size: 0.86rem;
    letter-spacing: 0.04em;
}

.memory-card.revealed,
.memory-card.matched {
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
}

.snake-grid {
    display: grid;
    grid-template-columns: repeat(14, minmax(0, 1fr));
    gap: 4px;
    max-width: 430px;
}

.snake-cell {
    aspect-ratio: 1;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(15, 23, 42, 0.05);
}

.snake-cell.snake {
    background: linear-gradient(135deg, #166534, #4ade80);
}

.snake-cell.head {
    background: linear-gradient(135deg, #14532d, #22c55e);
}

.snake-cell.food {
    background: linear-gradient(135deg, #dc2626, #fb7185);
}

.ttt-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 120px));
    gap: 10px;
    justify-content: start;
}

.ttt-cell {
    aspect-ratio: 1;
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    font-size: 2rem;
    font-weight: 800;
}

.settings-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.control-field {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.control-field input[type="color"] {
    width: 100%;
    height: 46px;
    border: none;
    padding: 0;
    background: transparent;
}

.control-field input[type="range"],
.control-field input[type="url"],
.control-field select {
    width: 100%;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.9);
    color: var(--ink);
}

.wallpaper-swatches {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.swatch {
    height: 58px;
    border-radius: 18px;
    background: transparent;
}

.swatch.bliss {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0)),
        url("../img/img1.webp") center center / cover no-repeat;
}

.swatch.aurora { background: linear-gradient(135deg, #071223, #1d4ed8); }
.swatch.sunset { background: linear-gradient(135deg, #7c2d12, #fdba74, #0f3f75); }
.swatch.matrix { background: linear-gradient(135deg, #031613, #0f766e); }
.swatch.graphite { background: linear-gradient(135deg, #111827, #475569); }

#background-upload {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.top-gap {
    margin-top: 16px;
}

@keyframes windowLaunch {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
