/* Windows 95 風格視窗 */
.nmh-window {
    position: absolute !important;
    width: 800px; /* 從 600px 增加 */
    height: 600px; /* 從 500px 增加 */
    max-width: 90vw;
    max-height: 85vh;
    background: #c0c0c0;
    border: 3px outset #fff; /* 從 2px 增加 */
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    z-index: 100;
    
    opacity: 0;
    transform: scale(0.9);
    animation: windowFadeIn 0.3s ease-out forwards;
}

@keyframes windowFadeIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 關閉時的淡出動畫 */
.nmh-window.closing {
    animation: windowFadeOut 0.25s ease-in forwards;
}

@keyframes windowFadeOut {
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

.nmh-window.active {
    z-index: 200;
}

.nmh-window.active {
    z-index: 200;
}

/* 標題列 */
.nmh-window-titlebar {
    background: linear-gradient(to right, #000080, #1084d0);
    color: #fff;
    padding: 5px 8px; /* 從 3px 5px 增加 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    user-select: none;
}

.nmh-window.inactive .nmh-window-titlebar {
    background: linear-gradient(to right, #808080, #a0a0a0);
}

.nmh-window-title {
    font-size: 14px; /* 從 11px 增加 */
    font-weight: bold;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nmh-window-title img {
    width: 20px; /* 從 16px 增加 */
    height: 20px;
    image-rendering: pixelated;
}


/* 標題列按鈕 */
.nmh-window-buttons {
    display: flex;
    gap: 3px;
}

.nmh-window-btn {
    width: 24px; /* 從 16px 增加 */
    height: 22px; /* 從 14px 增加 */
    background: #c0c0c0;
    border: 2px outset #fff;
    font-size: 14px; /* 從 10px 增加 */
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.nmh-window-btn:active {
    border-style: inset;
}

.nmh-window-btn-close {
    color: #000;
}

.nmh-window-btn-minimize {
    color: #000;
}

.nmh-window-btn-maximize {
    color: #000;
}

/* 視窗內容 */
.nmh-window-content {
    flex: 1;
    background: #fff;
    padding: 24px; /* 從 20px 增加 */
    overflow: auto;
    border: 2px inset #808080;
    margin: 3px;
    font-size: 16px; /* 增加內容字體 */
    line-height: 1.6;
}
/* 狀態列（選用） */
.nmh-window-statusbar {
    background: #c0c0c0;
    border-top: 1px solid #808080;
    padding: 2px 5px;
    font-size: 10px;
    color: #000;
}

/* 響應式 */
@media (max-width: 768px) {
    .nmh-window {
        min-width: 90vw;
        min-height: 50vh;
        left: 5vw !important;
        top: 10vh !important;
    }
}


/* Memory Game */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ccc;
}

.game-restart {
    background: #c0c0c0;
    border: 2px outset #fff;
    padding: 5px 15px;
    cursor: pointer;
    font-size: 14px;
}

.game-restart:active {
    border-style: inset;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 0 auto;
}

.memory-card {
    aspect-ratio: 1;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.3s;
}

.memory-card.flipped {
    transform: rotateY(180deg);
}

.memory-card.matched {
    opacity: 0.6;
    cursor: default;
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.card-front {
    background: #008080;
}

.card-back {
    background: #fff;
    transform: rotateY(180deg);
    padding: 10px;
}

.card-back img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}


/* 工作列 - 放大 */
.nmh-taskbar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px; /* 從 40px 增加 */
    background: #c0c0c0;
    border-top: 2px solid #fff;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    padding: 0 8px;
    z-index: 1000;
}

.nmh-taskbar-items {
    display: flex;
    gap: 6px;
    flex: 1;
    overflow-x: auto;
}

.nmh-taskbar-item {
    background: #c0c0c0;
    border: 2px outset #fff;
    padding: 6px 16px; /* 從 4px 12px 增加 */
    font-size: 13px; /* 從 11px 增加 */
    cursor: pointer;
    max-width: 220px;
    min-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.nmh-taskbar-item img {
    width: 20px; /* 從 16px 增加 */
    height: 20px;
    image-rendering: pixelated;
    flex-shrink: 0;
}
