/* Global */
:root {
    --taskbar-height: 46px;
    --taskbar-offset: calc(var(--taskbar-height) + env(safe-area-inset-bottom, 0px));
}

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

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        sans-serif;
    background: linear-gradient(135deg, #60a5fa, #a855f7);
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

.desktop--locked {
    opacity: 0;
    filter: blur(3px);
    pointer-events: none;
    transition: opacity 0.4s ease, filter 0.4s ease;
}

.desktop--unlocked {
    opacity: 1;
    filter: none;
}

.login-screen {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: stretch;
    justify-content: center;
    color: #ffffff;
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    overflow: hidden;
}

.login-screen__background {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.2), transparent 55%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.15), transparent 55%),
        linear-gradient(135deg, #1d4ed8 0%, #1e40af 40%, #111827 100%);
    filter: blur(1px);
    z-index: 0;
}

.login-screen__content {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 48px;
}

.login-screen__top-bar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    min-height: 32px;
}

.login-screen__language {
    padding: 4px 10px;
    background: rgba(15, 23, 42, 0.3);
    border-radius: 4px;
    font-size: 12px;
    border: 1px solid rgba(148, 163, 184, 0.5);
}

.login-screen__card {
    margin: auto;
    padding: 32px 36px 28px;
    background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.2), transparent 60%),
        rgba(15, 23, 42, 0.65);
    border-radius: 18px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 320px;
    max-width: 420px;
    border: 1px solid rgba(148, 163, 184, 0.8);
}

.login-screen__avatar {
    width: 120px;
    height: 120px;
    border-radius: 24px;
    background: radial-gradient(circle at 30% 20%, #fdfdfd, #abbdf8);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.6);
}

.login-screen__avatar-icon {
    font-size: 64px;
}

.login-screen__username {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 12px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
}

.login-screen__hint {
    width: 100%;
    margin: 0 0 20px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.45;
    text-align: center;
    color: #e2e8f0;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(147, 197, 253, 0.45);
    border-radius: 8px;
}

.login-screen__hint strong {
    font-weight: 600;
    color: #f8fafc;
}

.login-screen__form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-screen__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.login-screen__field-label {
    font-size: 12px;
    opacity: 0.85;
}

.login-screen__input {
    width: 100%;
    padding: 8px 10px;
    border-radius: 3px;
    border: 1px solid rgba(148, 163, 184, 0.9);
    background: rgba(15, 23, 42, 0.85);
    color: #e5e7eb;
    font-size: 14px;
}

.login-screen__input[readonly] {
    cursor: default;
}

.login-screen__button {
    margin-top: 16px;
    align-self: flex-end;
    min-width: 110px;
    padding: 8px 20px;
    border-radius: 3px;
    border: 1px solid rgba(148, 163, 184, 0.9);
    background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 50%, #1e40af 100%);
    color: #f9fafb;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.7);
}

.login-screen__button:hover {
    background: linear-gradient(180deg, #60a5fa 0%, #2563eb 50%, #1e40af 100%);
}

.login-screen__button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.7);
}

.login-screen__bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 20px;
    font-size: 13px;
    color: rgba(226, 232, 240, 0.9);
}

.login-screen__brand {
    font-weight: 500;
}

.login-screen__actions {
    display: flex;
    gap: 10px;
}

.login-screen__icon-button {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(148, 163, 184, 0.8);
    background: rgba(15, 23, 42, 0.6);
    color: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: default;
}

.login-screen__icon-button:hover {
    background: rgba(30, 64, 175, 0.9);
}

.login-screen--hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.02);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

@media (max-width: 768px) {
    html {
        touch-action: manipulation;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    input,
    select,
    textarea {
        font-size: 16px;
    }

    .login-screen__content {
        padding: 24px 20px;
    }

    .login-screen__card {
        padding: 24px 22px 20px;
        min-width: 0;
        width: 100%;
        max-width: 360px;
    }

    .login-screen__avatar {
        width: 96px;
        height: 96px;
        border-radius: 18px;
    }

    .login-screen__avatar-icon {
        font-size: 52px;
    }

    .login-screen__username {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .login-screen__hint {
        font-size: 12px;
        margin-bottom: 16px;
        padding: 8px 10px;
    }

    .login-screen__bottom-bar {
        font-size: 12px;
        padding-top: 16px;
    }
}

.desktop {
    position: relative;
    z-index: 1;
    width: 100vw;
    height: 100dvh;
    overflow: hidden;
    background-image: url('../img/background/desktop-background-image.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Desktop icons */
.desktop-icon {
    position: absolute;
    width: 90px;
    padding: 12px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border-radius: 8px;
    cursor: pointer;
    color: #fff;
    transition: background 0.15s, transform 0.15s;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.desktop-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.desktop-icon__icon {
    font-size: 28px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.desktop-icon__icon-image {
    display: block;
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 6px;
}

.desktop-icon__label {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* Windows */
.window {
    position: absolute;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-width: calc(100vw - 20px);
    max-height: calc(100dvh - var(--taskbar-offset) - 20px);
    min-width: 300px;
    min-height: 200px;
}

.window--hidden {
    display: none;
}

.window--minimised {
    display: none;
}

.window__titlebar {
    background: linear-gradient(90deg, #2563eb, #1d4ed8);
    color: #ffffff;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: move;
    position: relative;
    z-index: 20;
}

.window__title {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.window__controls {
    display: flex;
    gap: 6px;
    position: relative;
    z-index: 30;
    flex-shrink: 0;
    touch-action: manipulation;
}

.window__btn {
    border: none;
    outline: none;
    background: transparent;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    color: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.window__btn:hover {
    background: rgba(15, 23, 42, 0.25);
}

.window__btn--close:hover {
    background: #dc2626;
}

.window__btn--max:hover {
    background: rgba(15, 23, 42, 0.25);
}

.window--maximised {
    left: 0 !important;
    top: 0 !important;
    width: 100vw !important;
    height: calc(100dvh - var(--taskbar-offset)) !important;
    max-width: 100vw !important;
    max-height: calc(100dvh - var(--taskbar-offset)) !important;
    border-radius: 0;
}

.window__body {
    flex: 1;
    overflow: auto;
    padding: 18px 20px;
    font-size: 14px;
    color: #111827;
}

/* Resize handles */
.window__resize-handle {
    position: absolute;
    background: transparent;
    z-index: 10;
}

.window__resize-handle--n {
    top: 0;
    left: 5px;
    right: 5px;
    height: 5px;
    cursor: n-resize;
    z-index: 5;
}

.window__resize-handle--s {
    bottom: 0;
    left: 5px;
    right: 5px;
    height: 5px;
    cursor: s-resize;
}

.window__resize-handle--e {
    top: 5px;
    bottom: 5px;
    right: 0;
    width: 5px;
    cursor: e-resize;
}

.window__resize-handle--w {
    top: 5px;
    bottom: 5px;
    left: 0;
    width: 5px;
    cursor: w-resize;
}

.window__resize-handle--ne {
    top: 0;
    right: 0;
    width: 10px;
    height: 10px;
    cursor: ne-resize;
    z-index: 5;
}

.window__resize-handle--nw {
    top: 0;
    left: 0;
    width: 10px;
    height: 10px;
    cursor: nw-resize;
    z-index: 5;
}

.window__resize-handle--se {
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    cursor: se-resize;
}

.window__resize-handle--sw {
    bottom: 0;
    left: 0;
    width: 10px;
    height: 10px;
    cursor: sw-resize;
}

.window--maximised .window__resize-handle {
    display: none;
}

/* Taskbar */
.taskbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--taskbar-height);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #111827;
    color: #e5e7eb;
    display: flex;
    align-items: center;
    padding: 0 8px;
    box-shadow: 0 -2px 4px rgba(15, 23, 42, 0.5);
    z-index: 1000;
    opacity: 0.9;
}

.taskbar__start {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 6px;
    border: none;
    background: #1f2937;
    color: #e5e7eb;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-right: 8px;
}

.taskbar__start:hover {
    background: #374151;
}

.taskbar__windows {
    display: flex;
    align-items: stretch;
    gap: 6px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: thin;
}

.taskbar-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    border: none;
    background: #374151;
    color: #e5e7eb;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    min-width: 110px;
}

.taskbar-item--minimised {
    background: #1f2937;
}

.taskbar-item:hover {
    background: #4b5563;
}

.taskbar-item__icon {
    font-size: 14px;
}

.taskbar-item__close {
    margin-left: auto;
    margin-right: 4px;
    width: 18px;
    height: 18px;
    border: none;
    background: transparent;
    color: #9ca3af;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    padding: 0;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s;
}

.taskbar-item:hover .taskbar-item__close {
    opacity: 1;
}

.taskbar-item__close:hover {
    background: rgba(220, 38, 38, 0.2);
    color: #dc2626;
}

.taskbar__clock {
    padding: 0 10px;
    font-size: 12px;
    flex-shrink: 0;
}

/* Start menu */
.start-menu {
    position: fixed;
    left: 0;
    bottom: var(--taskbar-offset);
    width: 100%;
    max-width: 520px;
    background: #1e1e1e;
    color: #e5e7eb;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 0 18px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    z-index: 900;
    max-height: calc(100dvh - var(--taskbar-offset));
    display: flex;
    flex-direction: column;
}

.start-menu--hidden {
    display: none;
}

.start-menu__header {
    background: linear-gradient(90deg, #2563eb, #1d4ed8);
    padding: 14px 16px;
}

.start-menu__title {
    font-size: 16px;
    font-weight: 700;
}

.start-menu__content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.start-menu__footer {
    padding: 8px 12px 12px;
    border-top: 1px solid #111827;
    display: flex;
    justify-content: flex-end;
    background: #111827;
}

.start-menu__logout {
    padding: 8px 18px;
    border-radius: 999px;
    border: 1px solid #4b5563;
    background: #111827;
    color: #e5e7eb;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.start-menu__logout::before {
    content: " 📴";
    font-size: 14px;
}

.start-menu__logout:hover {
    background: #1f2937;
    border-color: #6b7280;
}

.start-menu__section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.start-menu__section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px;
}

.start-menu__section-title {
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.start-menu__section-more {
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
}

.start-menu__section-more:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
}

/* Pinned Apps Grid */
.start-menu__pinned {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    padding: 4px;
}

@media (max-width: 768px) {
    .start-menu__pinned {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .start-menu__pinned {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .start-menu__app-icon {
        font-size: 28px;
    }

    .start-menu__app-label {
        font-size: 10px;
    }
}

.start-menu__app {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    border: none;
    background: transparent;
    color: inherit;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    min-width: 0;
}

.start-menu__app:hover {
    background: rgba(255, 255, 255, 0.1);
}

.start-menu__app-icon {
    font-size: 32px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
    line-height: 1;
}

.start-menu__app-icon-image {
    display: block;
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
}

.start-menu__app-label {
    font-size: 11px;
    text-align: center;
    color: #e5e7eb;
    font-weight: 500;
    word-break: break-word;
    line-height: 1.2;
    max-width: 100%;
}

/* Recommended Files */
.start-menu__recommended {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px;
}

.start-menu__empty {
    margin: 0;
    padding: 10px 12px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
}

.start-menu__file {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: inherit;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}

.start-menu__file:hover {
    background: rgba(255, 255, 255, 0.1);
}

.start-menu__file-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.start-menu__file-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.start-menu__file-name {
    font-size: 13px;
    color: #e5e7eb;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.start-menu__file-meta {
    font-size: 11px;
    color: #9ca3af;
}

/* File Explorer */
.window__body.files {
    padding: 0;
}

/* Snake Game */
.window__body.snake {
    padding: 20px;
    background: #0f172a;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.files {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #f3f4f6;
    overflow: hidden;
}

.files__view {
    display: none;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.files__view--active {
    display: flex;
}

/* Main View */
.files__view--main {
    padding: 20px;
    overflow-y: auto;
}

.files__view--main h2 {
    font-size: 24px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 20px;
}

.files__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.files__button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 24px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 140px;
    text-align: center;
}

.files__button:hover {
    background: #f9fafb;
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.files__button-icon {
    font-size: 32px;
    line-height: 1;
}

.files__button span:not(.files__button-icon) {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
}

/* Header with Back Button */
.files__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.files__back {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    color: #374151;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}

.files__back:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.files__header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

/* File Table */
.files__table {
    flex: 1;
    overflow-y: auto;
    background: #ffffff;
    margin: 0;
    padding: 0;
}

.files__table-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 10px 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background 0.15s;
    text-align: left;
    width: 100%;
    font-size: 14px;
    color: #111827;
    border-bottom: 1px solid #f3f4f6;
}

.files__table-row:hover {
    background: #f3f4f6;
}

.files__table-row--head {
    background: #f9fafb;
    font-weight: 600;
    color: #6b7280;
    cursor: default;
    border-bottom: 2px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 10;
}

.files__table-row--head:hover {
    background: #f9fafb;
}

.files__table-row span:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
}

.files__table-row span:last-child {
    color: #6b7280;
    font-size: 13px;
}

.files__icon {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
}

/* Video Player View */
.files__view--video-player {
    padding: 16px;
    overflow-y: auto;
}

.files__view--video-player .files__header {
    margin: -16px -16px 16px -16px;
    padding: 12px 16px;
}

.files__view--video-player video {
    width: 100%;
    max-width: 100%;
    height: auto;
    background: #000000;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Image Viewer */
.files__view--image-viewer {
    padding: 16px;
    overflow-y: auto;
}

.files__view--image-viewer .files__header {
    margin: -16px -16px 16px -16px;
    padding: 12px 16px;
}

.files__view--image-viewer img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: #f9fafb;
}

/* Documents View */
.files__view--docs {
    padding: 16px;
    overflow-y: auto;
}

.files__view--docs .files__header {
    margin: -16px -16px 16px -16px;
    padding: 12px 16px;
}

.docs-list__empty {
    margin: 0;
    padding: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.docs-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.doc {
    padding: 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    transition: all 0.15s;
}

.doc:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.doc h3 {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.doc p {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

/* PDF Viewer View */
.files__view--pdf-viewer {
    padding: 16px;
    overflow-y: auto;
}

.files__view--pdf-viewer .files__header {
    margin: -16px -16px 16px -16px;
    padding: 12px 16px;
}

.files__view--pdf-viewer iframe {
    width: 100%;
    height: calc(100vh - 200px);
    min-height: 600px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background: #f9fafb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Content helpers, projects, skills, contact etc. */
.window__body {
    background: #f3f4f6;
}

/* About Window */
.window__body h2 {
    font-size: 24px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.window__body p {
    font-size: 14px;
    line-height: 1.7;
    color: #374151;
    margin-bottom: 16px;
}

/* Projects Window */
.window__body.projects {
    padding: 18px 20px 24px;
}

.projects__header {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 2px solid #e5e7eb;
}

.projects__header h2 {
    margin-bottom: 8px;
    padding-bottom: 0;
    border-bottom: none;
}

.projects__lead {
    font-size: 14px;
    line-height: 1.65;
    color: #4b5563;
    max-width: 640px;
}

.projects__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.projects__card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.projects__card:hover {
    border-color: #3b82f6;
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.12);
    transform: translateY(-2px);
}

.projects__tag {
    align-self: flex-start;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1d4ed8;
    background: #dbeafe;
    padding: 4px 10px;
    border-radius: 999px;
}

.projects__title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    color: #111827;
}

.projects__meta {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

.projects__desc {
    font-size: 13px;
    line-height: 1.55;
    color: #4b5563;
    flex: 1;
}

.projects__open-btn {
    margin-top: 4px;
    align-self: flex-start;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    background: #2563eb;
    border: 1px solid #2563eb;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.projects__open-btn:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

/* Skills Window */
.skills-core-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skills-core-list li {
    position: relative;
    padding: 10px 12px 10px 28px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;
    color: #111827;
}

.skills-core-list li::before {
    content: "";
    position: absolute;
    left: 12px;
    top: 50%;
    width: 6px;
    height: 6px;
    margin-top: -3px;
    background: #3b82f6;
    border-radius: 1px;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.skills-section {
    padding: 20px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s;
}

.skills-section:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

.skills-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f3f4f6;
}

.skills-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.skills-section li {
    font-size: 14px;
    color: #374151;
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
}

.skills-section li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: #3b82f6;
    font-weight: bold;
}

/* Contact Window */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-form__group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.contact-form__label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.contact-form__input,
.contact-form__textarea {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: #ffffff;
    color: #111827;
    transition: all 0.15s;
}

.contact-form__input:focus,
.contact-form__textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.contact-form__textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-form__button {
    padding: 12px 24px;
    background: linear-gradient(90deg, #2563eb, #1d4ed8);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    align-self: flex-start;
}

.contact-form__button:hover {
    background: linear-gradient(90deg, #1d4ed8, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.contact-form__button:active {
    transform: translateY(0);
}

.contact-form__message {
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 8px;
    display: none;
}

.contact-form__message--success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
    display: block;
}

.contact-form__message--error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    display: block;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.contact-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.contact-link {
    font-size: 14px;
    color: #3b82f6;
    text-decoration: none;
    word-break: break-word;
}

.contact-link:hover {
    text-decoration: underline;
}

/* Browser Window */
.window__body.browser {
    padding: 0;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    overflow: hidden;
    min-height: 0;
}

.browser__toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
}

.browser__nav-buttons {
    display: flex;
    gap: 4px;
}

.browser__nav-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #374151;
    transition: all 0.15s;
}

.browser__nav-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.browser__nav-btn:active {
    background: #f3f4f6;
}

.browser__address-bar {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.browser__lock-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.browser__url {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    color: #111827;
    font-family: inherit;
}

.browser__stage {
    flex: 1;
    position: relative;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.browser__content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    background: #ffffff;
}

.browser__content--scroll-locked {
    overflow: hidden;
}

.browser__external {
    position: absolute;
    inset: 0;
    background: #ffffff;
}

.browser__external--hidden {
    display: none;
}

.browser__external-frame {
    width: 100%;
    height: 100%;
    border: 0;
    background: #ffffff;
}

/* OSRS Hiscores (in-browser, API-backed) */
.osrs-hiscores__header {
    margin-bottom: 1rem;
}

.osrs-hiscores__title {
    margin-bottom: 0.35rem;
}

.osrs-hiscores__player-name {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #1a4d1a;
}

.osrs-hiscores__overall-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    color: #333;
}

.osrs-hiscores__notice {
    margin: 0;
    font-size: 0.85rem;
    color: #555;
    line-height: 1.45;
}

.osrs-hiscores__official-link {
    color: #0b4ea2;
    text-decoration: underline;
}

.osrs-hiscores__status {
    min-height: 1.25rem;
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    color: #555;
}

.osrs-hiscores__status--loading {
    color: #333;
}

.osrs-hiscores__status--error {
    color: #a11;
}

.osrs-hiscores__table-wrap {
    overflow: auto;
    border: 1px solid #c0c0c0;
    background: #f4f0e6;
}

.osrs-hiscores__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.osrs-hiscores__table th,
.osrs-hiscores__table td {
    padding: 0.4rem 0.65rem;
    text-align: left;
    border-bottom: 1px solid #d8d0c0;
}

.osrs-hiscores__table th {
    background: #e8e0d0;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.osrs-hiscores__table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.45);
}

.osrs-hiscores__table td:nth-child(n + 2) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Portfolio Website Inside Browser */
.portfolio-site {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Top Header */
.portfolio-site__top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.portfolio-site__logo {
    font-size: 20px;
    font-weight: 600;
    color: #374151;
}

.portfolio-site__top-nav {
    display: flex;
    gap: 0;
}

.portfolio-site__top-nav-link {
    padding: 8px 16px;
    color: #374151;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.portfolio-site__top-nav-link:hover {
    color: #2563eb;
}

.portfolio-site__top-nav-link--active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

/* Page System */
.portfolio-site__page {
    display: none;
    flex: 1 1 auto;
}

.portfolio-site__page--active {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Hero Section (Home Page) */
.portfolio-site__hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 60px 40px;
    position: relative;
}

.portfolio-site__hero-content {
    display: flex;
    align-items: center;
    gap: 60px;
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.portfolio-site__hero-text {
    flex: 1;
    z-index: 2;
}

.portfolio-site__hero-greeting {
    font-size: 48px;
    font-weight: 400;
    color: #374151;
    margin-bottom: 10px;
    line-height: 1.2;
}

.portfolio-site__hero-name-highlight {
    color: #2563eb;
    font-weight: 700;
}

.portfolio-site__hero-title {
    font-size: 48px;
    font-weight: 400;
    color: #374151;
    margin-bottom: 30px;
    line-height: 1.2;
}

.portfolio-site__hero-title-past {
    text-decoration: line-through;
    text-decoration-thickness: 2px;
}

.portfolio-site__hero-title-role {
    margin-left: 0.25em;
}

.portfolio-site__hero-button {
    padding: 14px 32px;
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.portfolio-site__hero-button:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.portfolio-site__hero-image {
    flex: 1;
    position: relative;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-site__hero-blob {
    position: absolute;
    width: 350px;
    height: 350px;
    background: #2563eb;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    top: 0;
    left: 0;
    z-index: 1;
    animation: blob 8s ease-in-out infinite;
}

@keyframes blob {

    0%,
    100% {
        border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%;
        transform: translate(10px, -10px) rotate(5deg);
    }

    50% {
        border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%;
        transform: translate(0, -20px) rotate(-5deg);
    }

    75% {
        border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%;
        transform: translate(-10px, -10px) rotate(5deg);
    }
}

.portfolio-site__hero-photo {
    position: relative;
    z-index: 2;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 4px solid #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.portfolio-site__hero-photo-placeholder {
    font-size: 120px;
    color: #9ca3af;
}

.portfolio-site__social {
    display: flex;
    gap: 20px;
    margin-top: 40px;
    padding-left: 40px;
}

.portfolio-site__social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #374151;
    text-decoration: none;
    transition: color 0.2s;
}

.portfolio-site__social-link:hover {
    color: #2563eb;
}

.portfolio-site__social-icon {
    display: block;
    flex-shrink: 0;
}

.portfolio-site__projects-intro {
    margin-bottom: 0;
}

.portfolio-site__projects-intro.portfolio-site__section {
    margin-bottom: 28px;
}

.portfolio-site__subsection-title {
    margin: 0 0 12px;
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    text-align: center;
}

.portfolio-site__external-websites {
    width: 100%;
    margin-top: 0;
    margin-bottom: 0;
    max-width: none;
    box-sizing: border-box;
}

.portfolio-site__external-websites.portfolio-site__section {
    margin-bottom: 36px;
}

.portfolio-site__external-websites-copy {
    margin: 0 0 16px;
    color: #4b5563;
    text-align: center;
    width: 100%;
}

.portfolio-site__external-websites-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    width: 100%;
}

.portfolio-site__external-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 40px;
    padding: 8px 14px;
    box-sizing: border-box;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #1f2937;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.portfolio-site__external-link:hover {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}

.portfolio-site__main {
    flex: 1 1 auto;
    padding: 60px 40px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

#page-projects .portfolio-site__main {
    max-width: none;
}

/* About Page */
.portfolio-site__about-content {
    font-size: 16px;
    line-height: 1.8;
    color: #374151;
}

.portfolio-site__about-content p {
    margin-bottom: 20px;
}

/* Projects Page */
.portfolio-site__projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.portfolio-site__project-card {
    background: #f9fafb;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s;
}

.portfolio-site__project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: #2563eb;
}

.portfolio-site__project-title {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 10px;
}

.portfolio-site__project-tech {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 12px;
    font-weight: 500;
}

.portfolio-site__project-desc {
    font-size: 14px;
    line-height: 1.6;
    color: #4b5563;
    margin: 0;
}

/* Case Studies */
.portfolio-site__case-studies-intro {
    margin-bottom: 24px;
}

.portfolio-site__case-studies-intro.portfolio-site__section {
    margin-bottom: 20px;
}

.portfolio-site__case-studies-lead {
    max-width: 860px;
    margin: 0 auto;
    text-align: center;
    font-size: 16px;
    line-height: 1.8;
    color: #4b5563;
}

.portfolio-site__case-studies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 20px;
}

.portfolio-site__case-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.portfolio-site__case-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 10px 26px rgba(37, 99, 235, 0.14);
    transform: translateY(-3px);
}

.portfolio-site__case-card-tag {
    display: inline-flex;
    align-self: flex-start;
    background: #dbeafe;
    color: #1d4ed8;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.portfolio-site__case-card-title {
    font-size: 20px;
    line-height: 1.35;
    color: #0f172a;
}

.portfolio-site__case-card-meta {
    font-size: 13px;
    color: #475569;
    font-weight: 600;
}

.portfolio-site__case-card-desc {
    font-size: 14px;
    line-height: 1.65;
    color: #475569;
}

.portfolio-site__case-card-btn {
    margin-top: auto;
    border: 1px solid #2563eb;
    background: #2563eb;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.portfolio-site__case-card-btn:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.portfolio-site__case-study {
    max-width: 960px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.portfolio-site__case-hero {
    margin-bottom: 26px;
    padding-bottom: 18px;
    border-bottom: 1px solid #e2e8f0;
}

.portfolio-site__case-kicker {
    color: #2563eb;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.portfolio-site__case-title {
    font-size: 33px;
    line-height: 1.2;
    color: #0f172a;
    margin-bottom: 14px;
}

.portfolio-site__case-subtitle {
    font-size: 16px;
    line-height: 1.7;
    color: #334155;
    margin-bottom: 16px;
}

.portfolio-site__case-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.portfolio-site__case-chip {
    background: #f1f5f9;
    border: 1px solid #dbe5f0;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
    color: #334155;
    font-weight: 600;
}

.portfolio-site__case-section {
    margin-bottom: 22px;
}

.portfolio-site__case-section h3 {
    font-size: 21px;
    color: #0f172a;
    margin-bottom: 10px;
}

.portfolio-site__case-section p {
    font-size: 15px;
    line-height: 1.75;
    color: #334155;
}

.portfolio-site__case-list {
    margin: 0;
    padding-left: 20px;
}

.portfolio-site__case-list li {
    color: #334155;
    line-height: 1.75;
    margin-bottom: 8px;
}

.portfolio-site__media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.portfolio-site__case-section--showcase>h3 {
    margin-bottom: 8px;
}

.portfolio-site__media-hint {
    margin: 0 0 28px;
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}

.portfolio-site__case-section--showcase .portfolio-site__media-grid {
    gap: 20px;
}

.portfolio-site__case-section--showcase .portfolio-site__media-grid+.portfolio-site__media-grid {
    margin-top: 32px;
}

.portfolio-site__media-placeholder {
    min-height: 140px;
    border: 1px dashed #93c5fd;
    border-radius: 10px;
    background: linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%);
    color: #1e40af;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px;
}

.portfolio-site__media-subsection {
    margin-top: 48px;
}

.portfolio-site__media-subsection:first-of-type {
    margin-top: 0;
}

.portfolio-site__media-subsection h4 {
    margin: 0 0 20px;
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
}

.portfolio-site__case-section--showcase .portfolio-site__media-grid--compare {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portfolio-site__case-section--showcase .portfolio-site__media-grid--stacked {
    grid-template-columns: 1fr;
}

.portfolio-site__media-grid--compare {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portfolio-site__media-figure {
    margin: 0;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    background: #ffffff;
}

.portfolio-site__case-study .portfolio-site__media-figure {
    cursor: zoom-in;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.portfolio-site__case-study .portfolio-site__media-figure:hover,
.portfolio-site__case-study .portfolio-site__media-figure:focus-within {
    border-color: #93c5fd;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
}

.portfolio-site__media-figure img {
    display: block;
    width: 100%;
    height: auto;
    vertical-align: middle;
}

.portfolio-site__case-study .portfolio-site__media-figure img {
    cursor: zoom-in;
}

.portfolio-site__media-figure figcaption {
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    line-height: 1.4;
}

.portfolio-site__lightbox {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    pointer-events: none;
}

.portfolio-site__lightbox--open {
    display: flex;
    pointer-events: auto;
}

.portfolio-site__lightbox-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    background: rgba(15, 23, 42, 0.82);
    cursor: zoom-out;
}

.portfolio-site__lightbox-panel {
    position: relative;
    z-index: 1;
    width: min(100%, 1200px);
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    overflow: auto;
}

.portfolio-site__lightbox-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 100%;
}

.portfolio-site__lightbox-nav {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    color: #0f172a;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: background 0.2s ease, opacity 0.2s ease;
}

.portfolio-site__lightbox-nav:hover:not(:disabled) {
    background: #f1f5f9;
}

.portfolio-site__lightbox-nav:disabled {
    opacity: 0.35;
    cursor: default;
}

.portfolio-site__lightbox-img {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    max-height: min(72vh, 640px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
    background: #ffffff;
}

.portfolio-site__lightbox-caption {
    margin: 0;
    max-width: 100%;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    color: #f8fafc;
    text-align: center;
    line-height: 1.4;
}

.portfolio-site__lightbox-counter {
    margin: -4px 0 0;
    font-size: 12px;
    font-weight: 600;
    color: #cbd5e1;
    text-align: center;
}

.portfolio-site__lightbox-close {
    position: absolute;
    top: -8px;
    right: 0;
    z-index: 2;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: #ffffff;
    color: #0f172a;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.portfolio-site__lightbox-close:hover {
    background: #f1f5f9;
}

.portfolio-site__case-footer {
    border-top: 1px solid #e2e8f0;
    margin-top: 6px;
    padding-top: 18px;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    flex-wrap: wrap;
}

.portfolio-site__case-nav-btn {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.portfolio-site__case-nav-btn:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.portfolio-site__case-nav-btn--primary {
    border-color: #2563eb;
    background: #2563eb;
    color: #ffffff;
}

.portfolio-site__case-nav-btn--primary:hover {
    border-color: #1d4ed8;
    background: #1d4ed8;
}

/* Contact Page */
.portfolio-site__contact-content {
    font-size: 16px;
    line-height: 1.8;
    color: #374151;
    max-width: 600px;
}

.portfolio-site__contact-info {
    margin-top: 30px;
}

.portfolio-site__contact-item {
    margin-bottom: 20px;
    font-size: 16px;
    color: #374151;
}

.portfolio-site__contact-item strong {
    color: #111827;
    margin-right: 8px;
}

.portfolio-site__contact-link {
    color: #2563eb;
    text-decoration: none;
}

.portfolio-site__contact-link:hover {
    text-decoration: underline;
}

.portfolio-site__section {
    margin-bottom: 60px;
}

.portfolio-site__section-title {
    font-size: 32px;
    font-weight: 700;
    color: #212529;
    margin-bottom: 40px;
    text-align: center;
}

.portfolio-site__section-title--skills {
    display: flex;
    align-items: center;
    gap: 10px;
}

.portfolio-site__section-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #3b82f6;
    font-size: 18px;
    flex-shrink: 0;
}

.portfolio-site__core-skills {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.portfolio-site__core-skill {
    position: relative;
    padding: 14px 16px 14px 36px;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    color: #212529;
    line-height: 1.4;
}

.portfolio-site__core-skill::before {
    content: "";
    position: absolute;
    left: 16px;
    top: 50%;
    width: 7px;
    height: 7px;
    margin-top: -3.5px;
    background: #3b82f6;
    border-radius: 1px;
}

.portfolio-site__skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.portfolio-site__skill-category {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    transition: all 0.3s;
}

.portfolio-site__skill-category:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.portfolio-site__skill-category-title {
    font-size: 20px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #dee2e6;
}

.portfolio-site__skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.portfolio-site__skill-tag {
    padding: 8px 16px;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    font-size: 14px;
    color: #495057;
    font-weight: 500;
    transition: all 0.2s;
}

.portfolio-site__skill-tag:hover {
    background: #667eea;
    color: #ffffff;
    border-color: #667eea;
    transform: scale(1.05);
}

.portfolio-site__footer {
    background: #212529;
    color: #ffffff;
    padding: 30px 40px;
    text-align: center;
    font-size: 14px;
    margin-top: auto;
}

/* Mobile Responsive Styles for Portfolio Website */
/* These classes are added via JavaScript based on browser window width */
.portfolio-site--tablet .portfolio-site__top-header,
.portfolio-site--mobile .portfolio-site__top-header {
    flex-direction: column;
    gap: 16px;
    padding: 16px 20px;
}

.portfolio-site--tablet .portfolio-site__logo,
.portfolio-site--mobile .portfolio-site__logo {
    font-size: 18px;
}

.portfolio-site--mobile .portfolio-site__logo {
    font-size: 16px;
}

.portfolio-site--tablet .portfolio-site__top-nav,
.portfolio-site--mobile .portfolio-site__top-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
}

.portfolio-site--tablet .portfolio-site__top-nav-link,
.portfolio-site--mobile .portfolio-site__top-nav-link {
    padding: 6px 12px;
    font-size: 14px;
}

.portfolio-site--mobile .portfolio-site__top-nav-link {
    padding: 6px 8px;
    font-size: 13px;
}

.portfolio-site--tablet .portfolio-site__hero,
.portfolio-site--mobile .portfolio-site__hero {
    padding: 40px 20px;
}

.portfolio-site--mobile .portfolio-site__hero {
    padding: 30px 16px;
}

.portfolio-site--tablet .portfolio-site__hero-content,
.portfolio-site--mobile .portfolio-site__hero-content {
    flex-direction: column;
    gap: 40px;
    text-align: center;
}

.portfolio-site--tablet .portfolio-site__hero-text,
.portfolio-site--mobile .portfolio-site__hero-text {
    order: 1;
}

.portfolio-site--tablet .portfolio-site__hero-image,
.portfolio-site--mobile .portfolio-site__hero-image {
    order: 2;
    height: 300px;
}

.portfolio-site--mobile .portfolio-site__hero-image {
    height: 250px;
}

.portfolio-site--tablet .portfolio-site__hero-greeting,
.portfolio-site--tablet .portfolio-site__hero-title,
.portfolio-site--mobile .portfolio-site__hero-greeting,
.portfolio-site--mobile .portfolio-site__hero-title {
    font-size: 32px;
}

.portfolio-site--mobile .portfolio-site__hero-greeting,
.portfolio-site--mobile .portfolio-site__hero-title {
    font-size: 24px;
}

.portfolio-site--tablet .portfolio-site__hero-blob,
.portfolio-site--mobile .portfolio-site__hero-blob {
    width: 250px;
    height: 250px;
}

.portfolio-site--mobile .portfolio-site__hero-blob {
    width: 200px;
    height: 200px;
}

.portfolio-site--tablet .portfolio-site__hero-photo,
.portfolio-site--mobile .portfolio-site__hero-photo {
    width: 200px;
    height: 200px;
}

.portfolio-site--mobile .portfolio-site__hero-photo {
    width: 160px;
    height: 160px;
}

.portfolio-site--tablet .portfolio-site__hero-photo-placeholder,
.portfolio-site--mobile .portfolio-site__hero-photo-placeholder {
    font-size: 80px;
}

.portfolio-site--mobile .portfolio-site__hero-photo-placeholder {
    font-size: 60px;
}

.portfolio-site--tablet .portfolio-site__social,
.portfolio-site--mobile .portfolio-site__social {
    padding-left: 20px;
    margin-top: 30px;
    justify-content: center;
}

.portfolio-site--tablet .portfolio-site__external-websites,
.portfolio-site--mobile .portfolio-site__external-websites {
    margin-top: 36px;
}

.portfolio-site--tablet .portfolio-site__subsection-title,
.portfolio-site--mobile .portfolio-site__subsection-title {
    font-size: 24px;
}

.portfolio-site--tablet .portfolio-site__main,
.portfolio-site--mobile .portfolio-site__main {
    padding: 40px 20px;
}

.portfolio-site--mobile .portfolio-site__main {
    padding: 30px 16px;
}

.portfolio-site--tablet .portfolio-site__section-title,
.portfolio-site--mobile .portfolio-site__section-title {
    font-size: 28px;
    margin-bottom: 30px;
}

.portfolio-site--mobile .portfolio-site__section-title {
    font-size: 24px;
    margin-bottom: 24px;
}

.portfolio-site--tablet .portfolio-site__skills-grid,
.portfolio-site--mobile .portfolio-site__skills-grid {
    grid-template-columns: 1fr;
    gap: 20px;
}

.portfolio-site--tablet .portfolio-site__skill-category,
.portfolio-site--mobile .portfolio-site__skill-category {
    padding: 20px;
}

.portfolio-site--tablet .portfolio-site__projects-grid,
.portfolio-site--mobile .portfolio-site__projects-grid {
    grid-template-columns: 1fr;
    gap: 20px;
}

.portfolio-site--tablet .portfolio-site__project-card,
.portfolio-site--mobile .portfolio-site__project-card {
    padding: 20px;
}

.portfolio-site--tablet .portfolio-site__about-content,
.portfolio-site--tablet .portfolio-site__contact-content,
.portfolio-site--mobile .portfolio-site__about-content,
.portfolio-site--mobile .portfolio-site__contact-content {
    font-size: 15px;
}

.portfolio-site--mobile .portfolio-site__contact-item {
    font-size: 14px;
}

.portfolio-site--tablet .portfolio-site__footer,
.portfolio-site--mobile .portfolio-site__footer {
    padding: 20px;
    font-size: 13px;
}

.portfolio-site--mobile .portfolio-site__skill-tag {
    padding: 6px 12px;
    font-size: 13px;
}

.portfolio-site--mobile .portfolio-site__project-title {
    font-size: 18px;
}

.portfolio-site--mobile .portfolio-site__project-tech {
    font-size: 12px;
}

.portfolio-site--mobile .portfolio-site__project-desc {
    font-size: 13px;
}

.portfolio-site--tablet .portfolio-site__case-study,
.portfolio-site--mobile .portfolio-site__case-study {
    padding: 22px;
}

.portfolio-site--tablet .portfolio-site__case-title,
.portfolio-site--mobile .portfolio-site__case-title {
    font-size: 28px;
}

.portfolio-site--mobile .portfolio-site__case-title {
    font-size: 24px;
}

.portfolio-site--tablet .portfolio-site__case-studies-grid,
.portfolio-site--mobile .portfolio-site__case-studies-grid {
    grid-template-columns: 1fr;
}

.portfolio-site--tablet .portfolio-site__case-section h3,
.portfolio-site--mobile .portfolio-site__case-section h3 {
    font-size: 19px;
}

.portfolio-site--mobile .portfolio-site__case-section p,
.portfolio-site--mobile .portfolio-site__case-list li {
    font-size: 14px;
}

.portfolio-site--mobile .portfolio-site__case-footer {
    flex-direction: column;
}

.portfolio-site--mobile .portfolio-site__case-nav-btn {
    width: 100%;
}

.portfolio-site--mobile .portfolio-site__case-section--showcase .portfolio-site__media-grid--compare {
    grid-template-columns: 1fr;
}

.portfolio-site--mobile .portfolio-site__media-subsection {
    margin-top: 36px;
}

.portfolio-site--mobile .portfolio-site__case-section--showcase .portfolio-site__media-grid+.portfolio-site__media-grid {
    margin-top: 24px;
}

.portfolio-site--mobile .portfolio-site__lightbox {
    padding: 16px;
}

.portfolio-site--mobile .portfolio-site__lightbox-stage {
    gap: 8px;
}

.portfolio-site--mobile .portfolio-site__lightbox-nav {
    width: 36px;
    height: 36px;
    font-size: 24px;
}

.portfolio-site--mobile .portfolio-site__section {
    margin-bottom: 40px;
}

.portfolio-site--mobile .portfolio-site__hero-button {
    padding: 12px 24px;
    font-size: 14px;
}

/* Browser Toolbar Responsive */
.browser-window--tablet .browser__toolbar,
.browser-window--mobile .browser__toolbar {
    padding: 6px 8px;
    gap: 6px;
}

.browser-window--mobile .browser__toolbar {
    padding: 4px 6px;
    gap: 4px;
    flex-wrap: wrap;
}

.browser-window--tablet .browser__nav-btn,
.browser-window--mobile .browser__nav-btn {
    width: 28px;
    height: 28px;
    font-size: 14px;
}

.browser-window--mobile .browser__nav-btn {
    width: 24px;
    height: 24px;
    font-size: 12px;
}

.browser-window--tablet .browser__address-bar,
.browser-window--mobile .browser__address-bar {
    padding: 4px 8px;
    gap: 6px;
}

.browser-window--mobile .browser__address-bar {
    padding: 4px 6px;
    min-width: 0;
}

.browser-window--tablet .browser__url,
.browser-window--mobile .browser__url {
    font-size: 12px;
}

.browser-window--mobile .browser__url {
    font-size: 11px;
}

.browser-window--tablet .browser__lock-icon,
.browser-window--mobile .browser__lock-icon {
    font-size: 12px;
}

.browser-window--mobile .browser__lock-icon {
    font-size: 11px;
}

.browser-window--mobile .browser__nav-buttons {
    gap: 2px;
}

/* Legacy media queries for actual mobile/desktop viewports */
@media (max-width: 768px) {

    /* Browser Toolbar */
    .browser__toolbar {
        padding: 6px 8px;
        gap: 6px;
    }

    .browser__nav-btn {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .browser__address-bar {
        padding: 4px 8px;
        gap: 6px;
    }

    .browser__url {
        font-size: 12px;
    }

    .browser__lock-icon {
        font-size: 12px;
    }

    /* Top Header */
    .portfolio-site__top-header {
        flex-direction: column;
        gap: 16px;
        padding: 16px 20px;
    }

    .portfolio-site__logo {
        font-size: 18px;
    }

    .portfolio-site__top-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
    }

    .portfolio-site__top-nav-link {
        padding: 6px 12px;
        font-size: 14px;
    }

    /* Hero Section */
    .portfolio-site__hero {
        padding: 40px 20px;
    }

    .portfolio-site__hero-content {
        flex-direction: column;
        gap: 40px;
        text-align: center;
    }

    .portfolio-site__hero-text {
        order: 1;
    }

    .portfolio-site__hero-image {
        order: 2;
        height: 300px;
    }

    .portfolio-site__hero-greeting,
    .portfolio-site__hero-title {
        font-size: 32px;
    }

    .portfolio-site__hero-blob {
        width: 250px;
        height: 250px;
    }

    .portfolio-site__hero-photo {
        width: 200px;
        height: 200px;
    }

    .portfolio-site__hero-photo-placeholder {
        font-size: 80px;
    }

    .portfolio-site__social {
        padding-left: 20px;
        margin-top: 30px;
        justify-content: center;
    }

    /* Main Content */
    .portfolio-site__main {
        padding: 40px 20px;
    }

    .portfolio-site__section-title {
        font-size: 28px;
        margin-bottom: 30px;
    }

    /* Skills Grid */
    .portfolio-site__skills-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .portfolio-site__skill-category {
        padding: 20px;
    }

    /* Projects Grid */
    .portfolio-site__projects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .portfolio-site__project-card {
        padding: 20px;
    }

    /* About and Contact */
    .portfolio-site__about-content,
    .portfolio-site__contact-content {
        font-size: 15px;
    }

    .portfolio-site__footer {
        padding: 20px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {

    /* Browser Toolbar */
    .browser__toolbar {
        padding: 4px 6px;
        gap: 4px;
        flex-wrap: wrap;
    }

    .browser__nav-buttons {
        gap: 2px;
    }

    .browser__nav-btn {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .browser__address-bar {
        min-width: 0;
        padding: 4px 6px;
    }

    .browser__url {
        font-size: 11px;
    }

    .browser__lock-icon {
        font-size: 11px;
    }

    /* Top Header */
    .portfolio-site__top-header {
        padding: 12px 16px;
    }

    .portfolio-site__logo {
        font-size: 16px;
    }

    .portfolio-site__top-nav-link {
        padding: 6px 8px;
        font-size: 13px;
    }

    /* Hero Section */
    .portfolio-site__hero {
        padding: 30px 16px;
    }

    .portfolio-site__hero-greeting,
    .portfolio-site__hero-title {
        font-size: 24px;
    }

    .portfolio-site__hero-button {
        padding: 12px 24px;
        font-size: 14px;
    }

    .portfolio-site__hero-image {
        height: 250px;
    }

    .portfolio-site__hero-blob {
        width: 200px;
        height: 200px;
    }

    .portfolio-site__hero-photo {
        width: 160px;
        height: 160px;
    }

    .portfolio-site__hero-photo-placeholder {
        font-size: 60px;
    }

    /* Main Content */
    .portfolio-site__main {
        padding: 30px 16px;
    }

    .portfolio-site__section-title {
        font-size: 24px;
        margin-bottom: 24px;
    }

    .portfolio-site__section {
        margin-bottom: 40px;
    }

    /* Skill Tags */
    .portfolio-site__skill-tag {
        padding: 6px 12px;
        font-size: 13px;
    }

    /* Project Cards */
    .portfolio-site__project-title {
        font-size: 18px;
    }

    .portfolio-site__project-tech {
        font-size: 12px;
    }

    .portfolio-site__project-desc {
        font-size: 13px;
    }

    /* Contact */
    .portfolio-site__contact-item {
        font-size: 14px;
    }
}

.snake__board-wrap {
    flex: 1 1 0;
    min-height: 120px;
    min-width: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.snake__board {
    display: block;
    background: #020617;
    border-radius: 8px;
    touch-action: none;
    flex-shrink: 0;
}

/* Snake Loading Screen */
.snake__loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    flex-direction: column;
}

.snake__loading-content {
    text-align: center;
    color: #e5e7eb;
}

.snake__loading-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.snake__loading-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.snake__loading-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.snake__loading-text {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 30px;
    color: #cbd5e1;
}

.snake__loading-bar {
    width: 300px;
    height: 8px;
    background: #1e293b;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #334155;
    margin: 0 auto;
}

.snake__loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 50%, #3b82f6 100%);
    background-size: 200% 100%;
    animation: loading-progress 1s linear infinite, progress-fill 2s ease-out forwards;
    border-radius: 4px;
    width: 0%;
}

@keyframes loading-progress {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

@keyframes progress-fill {
    from {
        width: 0%;
    }

    to {
        width: 100%;
    }
}

/* Snake Mobile Controls */
.snake__mobile-controls {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 8px 4px;
    flex-shrink: 0;
}

.snake__controls-row {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.snake__control-btn {
    width: 60px;
    height: 60px;
    border: 2px solid #334155;
    background: #1e293b;
    color: #e5e7eb;
    font-size: 24px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.snake__control-btn:active {
    background: #3b82f6;
    border-color: #60a5fa;
    transform: scale(0.95);
}

.snake__control-btn:hover {
    background: #334155;
    border-color: #475569;
}

.window__body.snake--touch .snake__mobile-controls,
.window__body.invaders--touch .invaders__mobile-controls {
    display: flex;
}

@media (max-width: 768px) {

    #window-game,
    #window-invaders {
        min-width: 0;
        max-width: 100vw;
    }

    .window__body.snake,
    .window__body.invaders {
        padding: 10px 12px;
        min-height: 0;
    }

    .snake__loading-bar,
    .invaders__loading-bar {
        width: min(280px, 85vw);
    }

    .snake__loading-text,
    .invaders__loading-text {
        font-size: 16px;
        padding: 0 12px;
    }

    .window__body.invaders {
        flex: 1;
        min-height: 0;
    }

    .invaders__canvas-container {
        width: 100%;
        min-height: 180px;
        flex: 1 1 auto;
        padding: 4px;
    }

    .snake__info,
    .invaders__info {
        padding: 6px 8px;
    }

    .invaders__info-main {
        font-size: 13px;
        margin-bottom: 2px;
    }

    .invaders__info-sub {
        font-size: 11px;
    }

    .invaders__mobile-controls {
        display: flex;
        margin-top: 4px;
        padding: 6px 8px 2px;
    }

    .snake__control-btn {
        width: 56px;
        height: 56px;
    }

    .snake__header,
    .invaders__header {
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px 10px;
        font-size: 13px;
        margin-bottom: 8px;
    }

    .snake__game-content,
    .invaders__game-content {
        min-height: 0;
        overflow: hidden;
        gap: 6px;
    }

    .snake__game-content {
        justify-content: flex-start;
    }

    .snake__board-wrap {
        min-height: 0;
    }

    .snake__info {
        flex-shrink: 0;
    }

    .snake__mobile-controls {
        display: flex;
        margin-top: 8px;
        padding: 8px 8px 2px;
    }

    .invaders__control-btn {
        width: 64px;
        height: 64px;
    }

    .invaders__control-btn--shoot {
        width: 80px;
    }

    .invaders__menu-title {
        font-size: 28px;
    }

    .invaders__menu-btn {
        min-width: 200px;
        padding: 12px 24px;
    }
}

/* Snake Game Content */
.snake__game-content {
    position: relative;
    flex: 1;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    align-items: stretch;
    outline: none;
}

.snake__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #1e293b;
    border-radius: 6px;
    margin-bottom: 15px;
    color: #e5e7eb;
    font-weight: 600;
    flex-shrink: 0;
}

.snake__reset {
    background: #334155;
    border: 1px solid #475569;
    color: #e5e7eb;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.snake__reset:hover {
    background: #475569;
    border-color: #64748b;
}

.snake__info {
    text-align: center;
    padding: 15px;
    color: #e5e7eb;
    flex-shrink: 0;
}

.snake__info-main {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
}

.snake__info-main--danger {
    color: #ef4444;
}

.snake__info-sub {
    font-size: 13px;
    color: #94a3b8;
}

.snake__sub {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 5px;
}

/* Space Invaders */
.window__body.invaders {
    padding: 20px;
    background: #0f172a;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.invaders__loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    flex-direction: column;
}

.invaders__loading-content {
    text-align: center;
    color: #e5e7eb;
}

.invaders__loading-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.invaders__loading-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.invaders__loading-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: pulse 1.5s ease-in-out infinite;
}

.invaders__loading-text {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 30px;
    color: #cbd5e1;
}

.invaders__loading-bar {
    width: 300px;
    height: 8px;
    background: #1e293b;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #334155;
    margin: 0 auto;
}

.invaders__loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 50%, #3b82f6 100%);
    background-size: 200% 100%;
    animation: loading-progress 1s linear infinite, progress-fill 2s ease-out forwards;
    border-radius: 4px;
    width: 0%;
}

.invaders__game-content {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.invaders__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #1e293b;
    border-radius: 6px;
    margin-bottom: 15px;
    color: #e5e7eb;
    font-weight: 600;
    gap: 15px;
    flex-shrink: 0;
}

.invaders__reset {
    background: #334155;
    border: 1px solid #475569;
    color: #e5e7eb;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.invaders__reset:hover {
    background: #475569;
    border-color: #64748b;
}

.invaders__canvas-container {
    flex: 1 1 0;
    min-height: 0;
    background: #020617;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80%;
    margin: 0 auto;
    overflow: hidden;
    box-sizing: border-box;
}

#invaders-canvas {
    display: block;
    border-radius: 4px;
    max-width: 100%;
    max-height: 100%;
    box-sizing: border-box;
    object-fit: contain;
}

.invaders__info {
    text-align: center;
    padding: 15px;
    color: #e5e7eb;
    flex-shrink: 0;
}

.invaders__info-main {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
}

.invaders__info-main--danger {
    color: #ef4444;
}

.invaders__info-main--success {
    color: #16a34a;
}

.invaders__info-sub {
    font-size: 13px;
    color: #94a3b8;
}

.invaders__sub {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 5px;
}

.invaders__mobile-controls {
    display: none;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    padding: 15px;
    flex-shrink: 0;
}

.invaders__controls-row {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.invaders__control-btn {
    width: 70px;
    height: 70px;
    border: 2px solid #334155;
    background: #1e293b;
    color: #e5e7eb;
    font-size: 24px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.invaders__control-btn--shoot {
    width: 90px;
    background: #3b82f6;
    border-color: #60a5fa;
}

.invaders__control-btn:active {
    background: #3b82f6;
    border-color: #60a5fa;
    transform: scale(0.95);
}

.invaders__control-btn:hover {
    background: #334155;
    border-color: #475569;
}

.invaders__control-btn--shoot:hover {
    background: #2563eb;
    border-color: #3b82f6;
}

/* Menu Screen */
.invaders__menu {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    flex-direction: column;
}

.invaders__menu-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.3;
    z-index: 1;
    overflow: hidden;
}

#invaders-menu-canvas {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.invaders__menu-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #e5e7eb;
}

.invaders__menu-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 40px;
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
    color: #60a5fa;
    letter-spacing: 4px;
}

.invaders__menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.invaders__menu-btn {
    padding: 16px 48px;
    background: linear-gradient(90deg, #2563eb, #1d4ed8);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 200px;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.invaders__menu-btn:hover {
    background: linear-gradient(90deg, #1d4ed8, #1e40af);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.invaders__menu-btn:active {
    transform: translateY(0);
}

/* High Score Modal */
.invaders__hiscore-modal {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.invaders__hiscore-content {
    background: #1e293b;
    border: 2px solid #334155;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.invaders__hiscore-title {
    font-size: 28px;
    font-weight: 700;
    color: #60a5fa;
    text-align: center;
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.invaders__hiscore-list {
    margin-bottom: 20px;
}

.invaders__hiscore-header {
    display: grid;
    grid-template-columns: 60px 1fr 120px 80px;
    gap: 12px;
    padding: 12px;
    background: #0f172a;
    border-radius: 6px;
    margin-bottom: 8px;
    font-weight: 600;
    color: #94a3b8;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.invaders__hiscore-item {
    display: grid;
    grid-template-columns: 60px 1fr 120px 80px;
    gap: 12px;
    padding: 12px;
    background: #0f172a;
    border-radius: 6px;
    margin-bottom: 6px;
    color: #e5e7eb;
    font-size: 14px;
    transition: background 0.2s;
}

.invaders__hiscore-item:hover {
    background: #1e293b;
}

.invaders__hiscore-item span:first-child {
    color: #60a5fa;
    font-weight: 600;
}

.invaders__hiscore-item span:nth-child(2) {
    font-weight: 600;
    color: #fbbf24;
}

.invaders__hiscore-item span:nth-child(3) {
    text-align: right;
    color: #4ade80;
}

.invaders__hiscore-item span:nth-child(4) {
    text-align: right;
    color: #94a3b8;
}

.invaders__hiscore-empty {
    text-align: center;
    color: #94a3b8;
    padding: 40px;
    font-size: 16px;
}

.invaders__hiscore-close {
    width: 100%;
    padding: 12px;
    background: #334155;
    border: 1px solid #475569;
    color: #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    text-transform: uppercase;
}

.invaders__hiscore-close:hover {
    background: #475569;
    border-color: #64748b;
}

/* Name Entry */
.invaders__name-entry {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.invaders__name-entry-content {
    background: #1e293b;
    border: 2px solid #334155;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    min-width: 300px;
}

.invaders__name-entry-title {
    font-size: 32px;
    font-weight: 700;
    color: #4ade80;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.invaders__name-entry-subtitle {
    font-size: 16px;
    color: #94a3b8;
    margin-bottom: 30px;
}

.invaders__name-entry-input {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 24px;
}

.invaders__name-char {
    width: 60px;
    height: 60px;
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    background: #0f172a;
    border: 2px solid #334155;
    border-radius: 8px;
    color: #60a5fa;
    text-transform: uppercase;
    font-family: monospace;
    transition: all 0.2s;
}

.invaders__name-char:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
    background: #1e293b;
}

.invaders__name-entry-score {
    font-size: 18px;
    color: #e5e7eb;
    margin-bottom: 24px;
    font-weight: 600;
}

.invaders__name-entry-score span {
    color: #4ade80;
    font-size: 24px;
}

.invaders__name-entry-submit {
    padding: 12px 32px;
    background: linear-gradient(90deg, #2563eb, #1d4ed8);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.invaders__name-entry-submit:hover {
    background: linear-gradient(90deg, #1d4ed8, #1e40af);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Sticky notes — desktop-level guestbook (bottom-left; does not cover window close buttons) */
.sticky-notes {
    position: fixed;
    left: 16px;
    bottom: 58px;
    top: auto;
    right: auto;
    z-index: 60;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: min(320px, calc(100vw - 32px));
    font-family: "Segoe UI", "Tahoma", system-ui, sans-serif;
    pointer-events: none;
}

.sticky-notes:not(.sticky-notes--collapsed) {
    z-index: 2600;
}

.sticky-notes__peek,
.sticky-notes__panel {
    pointer-events: auto;
}

.sticky-notes__peek {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 2px solid #1a1a1a;
    border-radius: 6px;
    background: linear-gradient(180deg, #fff9b1 0%, #f5e675 100%);
    color: #1a1a1a;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 2px 2px 0 #1a1a1a, 4px 6px 14px rgba(15, 23, 42, 0.2);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sticky-notes__peek:hover {
    transform: translateY(-1px);
    box-shadow: 2px 3px 0 #1a1a1a, 5px 8px 16px rgba(15, 23, 42, 0.25);
}

.sticky-notes__peek-icon {
    font-size: 16px;
    line-height: 1;
}

.sticky-notes--collapsed .sticky-notes__peek {
    display: flex;
}

.sticky-notes--collapsed .sticky-notes__panel {
    display: none;
}

.sticky-notes__panel {
    width: min(320px, calc(100vw - 32px));
    max-height: min(520px, calc(100dvh - 80px));
    display: flex;
    flex-direction: column;
    border: 2px solid #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 2px 2px 0 #1a1a1a, 6px 10px 24px rgba(15, 23, 42, 0.28);
    animation: sticky-notes-in 0.35s ease-out;
}

@keyframes sticky-notes-in {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.sticky-notes__titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    background: linear-gradient(180deg, #f5e675 0%, #e8d44a 100%);
    border-bottom: 2px solid #1a1a1a;
    cursor: default;
}

.sticky-notes__titlebar-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.sticky-notes__title {
    font-size: 13px;
    font-weight: 700;
    color: #1a1a1a;
}

.sticky-notes__collapse,
.sticky-notes__close {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border: 1px solid rgba(26, 26, 26, 0.35);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.35);
    color: #1a1a1a;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.sticky-notes__collapse:hover,
.sticky-notes__close:hover {
    background: rgba(255, 255, 255, 0.65);
}

.sticky-notes__close:hover {
    background: #fecaca;
}

.sticky-notes__body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #fff9b1;
    padding: 10px 12px 12px;
    gap: 10px;
}

.sticky-notes__hint {
    font-size: 11px;
    line-height: 1.4;
    color: #3d3d00;
    margin: 0;
}

.sticky-notes__list {
    flex: 1;
    min-height: 80px;
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 2px;
    scrollbar-width: thin;
}

.sticky-notes__empty {
    font-size: 12px;
    color: #5c5c00;
    font-style: italic;
    text-align: center;
    padding: 16px 8px;
}

.sticky-note-card {
    background: #fffef0;
    border: 1px solid rgba(26, 26, 26, 0.2);
    border-radius: 4px;
    padding: 8px 10px;
    box-shadow: 1px 2px 4px rgba(15, 23, 42, 0.12);
    user-select: text;
}

.sticky-note-card--tilt-left {
    transform: rotate(-1.2deg);
}

.sticky-note-card--tilt-right {
    transform: rotate(1deg);
}

.sticky-note-card__meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 10px;
    color: #6b6b00;
}

.sticky-note-card__meta-end {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.sticky-note-card__delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 1px solid rgba(26, 26, 26, 0.25);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.6);
    color: #3d3d00;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}

.sticky-note-card__delete:hover:not(:disabled) {
    background: #fff;
    border-color: rgba(26, 26, 26, 0.45);
}

.sticky-note-card__delete:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sticky-note-card__author {
    font-weight: 700;
    color: #3d3d00;
}

.sticky-note-card__text {
    font-size: 12px;
    line-height: 1.45;
    color: #1a1a1a;
    white-space: pre-wrap;
    word-break: break-word;
    user-select: text;
}

.sticky-notes__form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px dashed rgba(26, 26, 26, 0.25);
    padding-top: 10px;
}

.sticky-notes__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sticky-notes__label {
    font-size: 11px;
    font-weight: 600;
    color: #3d3d00;
}

.sticky-notes__optional {
    font-weight: 400;
    opacity: 0.75;
}

.sticky-notes__author,
.sticky-notes__text {
    width: 100%;
    border: 1px solid rgba(26, 26, 26, 0.35);
    border-radius: 4px;
    padding: 6px 8px;
    font-family: inherit;
    font-size: 12px;
    background: #fffef5;
    color: #1a1a1a;
    user-select: text;
}

.sticky-notes__author:focus,
.sticky-notes__text:focus {
    outline: 2px solid #2563eb;
    outline-offset: 1px;
}

.sticky-notes__text {
    resize: vertical;
    min-height: 56px;
}

.sticky-notes__counter {
    align-self: flex-end;
    font-size: 10px;
    color: #6b6b00;
}

.sticky-notes__submit {
    align-self: flex-start;
    padding: 6px 14px;
    border: 2px solid #1a1a1a;
    border-radius: 4px;
    background: #1a1a1a;
    color: #fff9b1;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.sticky-notes__submit:hover:not(:disabled) {
    background: #374151;
    border-color: #374151;
}

.sticky-notes__submit:disabled {
    opacity: 0.6;
    cursor: wait;
}

.sticky-notes__status {
    min-height: 1.2em;
    font-size: 11px;
    color: #3d3d00;
    margin: 0;
}

.sticky-notes__status--error {
    color: #b91c1c;
}

.sticky-notes__status--success {
    color: #15803d;
}

@media (max-width: 768px) {
    .window__titlebar {
        min-height: 48px;
        padding: 6px 10px;
    }

    .window__btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        font-size: 18px;
    }

    .window__controls {
        gap: 4px;
    }
}

@media (max-width: 640px) {
    .sticky-notes {
        left: 10px;
        bottom: 54px;
        max-width: calc(100vw - 20px);
    }

    .sticky-notes__panel {
        max-height: min(58dvh, calc(100dvh - 120px));
        width: min(320px, calc(100vw - 20px));
    }

    .sticky-notes__list {
        max-height: min(160px, 28vh);
    }

    .sticky-notes__peek {
        padding: 10px 16px;
        min-height: 44px;
    }
}

@media (max-width: 900px) {
    .sticky-notes {
        left: 10px;
        bottom: calc(54px + env(safe-area-inset-bottom, 0px));
        max-width: calc(100vw - 20px);
    }

    .sticky-notes__panel {
        width: min(340px, calc(100vw - 20px));
        max-height: min(500px, calc(100dvh - 140px));
    }

    .sticky-notes__body {
        padding: 8px 10px 10px;
        gap: 8px;
    }

    .sticky-notes__titlebar {
        padding: 6px 8px;
    }

    .sticky-notes__hint {
        font-size: 10px;
        line-height: 1.35;
    }

    .sticky-notes__list {
        max-height: min(180px, 30dvh);
    }

    .sticky-notes__author,
    .sticky-notes__text {
        font-size: 11px;
        padding: 6px 7px;
    }
}

/* Clippy assistant */
.clippy {
    position: fixed;
    right: 24px;
    bottom: 58px;
    z-index: 55;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
    pointer-events: none;
    max-width: min(340px, calc(100vw - 32px));
}

.clippy--hidden {
    display: none;
}

.clippy__bubble,
.clippy__character {
    pointer-events: auto;
}

.clippy__bubble {
    position: relative;
    background: #fff9c4;
    border: 2px solid #1a1a1a;
    border-radius: 8px;
    padding: 14px 16px 12px;
    margin-bottom: 8px;
    box-shadow: 2px 2px 0 #1a1a1a, 4px 4px 12px rgba(15, 23, 42, 0.25);
    font-family: "Tahoma", "Segoe UI", system-ui, sans-serif;
    font-size: 13px;
    line-height: 1.45;
    color: #1a1a1a;
    animation: clippy-bubble-in 0.35s ease-out;
    max-height: min(420px, calc(100dvh - 120px));
    overflow-y: auto;
    overflow-x: hidden;
}

.clippy__bubble--hidden {
    display: none;
}

.clippy__bubble::after {
    content: "";
    position: absolute;
    right: 28px;
    bottom: -14px;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 14px solid #1a1a1a;
}

.clippy__bubble::before {
    content: "";
    position: absolute;
    right: 30px;
    bottom: -10px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 12px solid #fff9c4;
    z-index: 1;
}

@keyframes clippy-bubble-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.clippy__bubble-close {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 22px;
    height: 22px;
    border: 1px solid #9ca3af;
    border-radius: 3px;
    background: #f3f4f6;
    color: #374151;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.clippy__bubble-close:hover {
    background: #e5e7eb;
}

.clippy__title {
    font-weight: 700;
    font-size: 12px;
    margin-bottom: 6px;
    color: #1d4ed8;
}

.clippy__message {
    margin-bottom: 12px;
    padding-right: 12px;
}

.clippy__message strong {
    font-weight: 700;
}

.clippy__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.clippy__btn {
    padding: 6px 12px;
    font-size: 12px;
    font-family: inherit;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid #1a1a1a;
    font-weight: 600;
}

.clippy__btn--primary {
    background: linear-gradient(180deg, #3b82f6, #2563eb);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.clippy__btn--primary:hover {
    background: linear-gradient(180deg, #2563eb, #1d4ed8);
}

.clippy__btn--secondary {
    background: #f3f4f6;
    color: #111827;
}

.clippy__btn--secondary:hover {
    background: #e5e7eb;
}

.clippy__dismiss {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 0;
    border: none;
    background: none;
    color: #6b7280;
    font-size: 11px;
    text-decoration: underline;
    cursor: pointer;
    font-family: inherit;
}

.clippy__dismiss:hover {
    color: #374151;
}

.clippy__character {
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    filter: drop-shadow(0 4px 8px rgba(15, 23, 42, 0.35));
    transition: transform 0.15s ease;
}

.clippy__character:hover {
    transform: scale(1.05);
}

.clippy__character img {
    display: block;
    width: 96px;
    height: auto;
    aspect-ratio: 620 / 465;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.clippy-target--highlight {
    /* Do not change position — fixed/absolute targets (taskbar, icons) jump if set to relative */
    /* Keep below windows (z-index 100+) so highlights never paint over open apps */
    z-index: auto !important;
    outline: 3px solid #fbbf24 !important;
    outline-offset: 4px;
    border-radius: 8px;
    animation: clippy-pulse 1.2s ease-in-out infinite;
    box-shadow: 0 0 0 6px rgba(251, 191, 36, 0.35);
}

@keyframes clippy-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.4);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(251, 191, 36, 0.15);
    }
}

@media (max-width: 600px) {
    .clippy {
        right: 10px;
        bottom: calc(54px + env(safe-area-inset-bottom, 0px));
        max-width: calc(100vw - 24px);
    }

    .clippy__bubble {
        padding: 12px 12px 10px;
        margin-bottom: 6px;
        font-size: 12px;
        max-height: min(360px, calc(100dvh - 160px));
    }

    .clippy__message {
        margin-bottom: 10px;
        padding-right: 4px;
    }

    .clippy__actions {
        gap: 6px;
        margin-bottom: 8px;
    }

    .clippy__btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    .clippy__character img {
        width: 86px;
    }
}

@media (max-width: 380px) {
    .clippy {
        right: 8px;
        max-width: calc(100vw - 16px);
    }

    .clippy__bubble {
        padding: 10px 10px 8px;
        font-size: 11px;
    }

    .clippy__character img {
        width: 74px;
    }
}

/* etc… */