/* =========================================================
   Win95
   ========================================================= */

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

html, body {
    height: 100%;
    width: 100%;
    font-family: 'MS Sans Serif', 'Segoe UI', 'Tahoma', 'Arial', sans-serif;
    font-size: 12px;
    color: #000;
    overflow: hidden;
}

/* =========================================================
   MAIN GRID — Windows 95 Paint Layout
   grid-template-columns: auto 1fr
   grid-template-rows: min-content min-content 1fr 40px min-content
   ========================================================= */
.grid {
    width: 100%;
    height: 100vh;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: min-content min-content 1fr 40px min-content;
    background-color: #c0c0c0;
}

/* =========================================================
   WIN95 TITLE BAR — Navy blue with window buttons
   ========================================================= */
.win-titlebar {
    grid-area: 1 / 1 / 1 / -1;
    background: linear-gradient(90deg, #130080, #6200ff);
    color: #fff;
    font-weight: bold;
    font-size: 15px;
    padding: 7px 9px;
    display: flex;
    align-items: center;
    user-select: none;
    gap: 6px;
    letter-spacing: 0.3px;
    margin: 3px 2px 0 2px;
}

.win-titlebar-text {
    flex: 1;
    text-align: left;
    text-transform: uppercase;
}

.win-titlebar-buttons {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.win-titlebar-btn {
    width: 18px;
    height: 16px;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #fff #808080 #808080 #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    color: #000;
    outline: none;
    font-family: 'Webdings', 'MS Sans Serif', sans-serif;
}

.win-titlebar-btn:active {
    border-color: #808080 #fff #fff #808080;
}

.win-titlebar-btn-close {
    font-family: 'Segoe UI', 'Arial', sans-serif;
    font-size: 10px;
}

/* =========================================================
   TOP MENU BAR
   ========================================================= */
.upbar {
    grid-area: 2 / 1 / 2 / -1;
    background-color: #c0c0c0;
    padding: 2px 2px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.upbar-left,
.upbar-right {
    display: flex;
    align-items: center;
}

.upbar-opt {
    color: #000;
    text-decoration: none;
    padding: 2px 6px;
    font-size: 13px;
    font-family: 'MS Sans Serif', 'Segoe UI', 'Tahoma', sans-serif;
    cursor: pointer;
    border: 1px solid transparent;
    position: relative;
}

.upbar-opt:hover {
    box-shadow: 1px 1px #000,
                inset -1px -1px #808080,
                inset 1px 1px #fff;
}

.upbar-opt:visited {
    color: #000;
}

.upbar-opt:active {
    box-shadow: inset 1px 1px #000,
                inset 2px 2px #808080,
                1px 1px #fff;
}

/* First letter underline (Win95 accelerator key style) */
.upbar-opt-first {
    text-decoration: underline;
}

/* =========================================================
   LEFT SIDEBAR
   ========================================================= */
.sidebar {
    grid-column: 1 / 2;
    grid-row: 3 / -1;
    background-color: #c0c0c0;
    padding: 2px;
    display: grid;
    grid-template-columns: repeat(2, max-content);
    grid-gap: 1px;
    justify-content: center;
    align-content: start;
    overflow-y: auto;
}

.sidebar-item {
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    -moz-user-select: none;
    user-select: none;
    background-color: #c0c0c0;
    box-shadow: 1px 1px #000,
                inset -1px -1px #808080,
                inset 1px 1px #fff;
    width: 23px;
    height: 23px;
    font-size: 12px;
    font-family: 'MS Sans Serif', 'Segoe UI', 'Tahoma', sans-serif;
    text-decoration: none;
    color: #000;
    font-weight: bold;
}

.sidebar-item:hover {
    background-color: #d4d4d4;
}

.sidebar-item.active,
.sidebar-item:active {
    box-shadow: inset 1px 1px #000,
                inset 2px 2px #808080,
                1px 1px #fff;
    background-image: repeating-linear-gradient(
        to left bottom,
        rgba(255,255,255,.8),
        rgba(255,255,255,.8) .25px,
        rgba(128,128,128,.1) .25px,
        rgba(128,128,128,.1) .5px
    );
}

/* Separator within sidebar */
.sidebar-separator {
    grid-column: 1 / -1;
    height: 2px;
    background: #808080;
    border-bottom: 1px solid #fff;
    margin: 2px 0;
}

/* =========================================================
   CANVAS
   ========================================================= */
.canvas {
    grid-column: 2 / 3;
    grid-row: 3 / 4;
    background-color: #7b7b7b;
    box-shadow: inset 1px 1px #343434,
                inset -1px -1px #808080;
    padding: 4px;
    overflow: auto;
}

.canvas-white {
    background-color: #7b7b7b;
    min-height: calc(100% - 8px);
    padding: 16px;
    overflow: auto;
    display: flex;
    justify-content: center;
}

/* A4 white container for content */
.a4-container {
    width: 210mm;
    max-width: 100%;
    background: #fff;
    padding: 20px 24px;
    box-sizing: border-box;
}

/* =========================================================
   BOTTOM TOOLBAR
   ========================================================= */
.bottombar {
    grid-area: 4 / 1 / 4 / -1;
    background-color: #c0c0c0;
    padding: 2px 4px 2px 2px;
    display: flex;
    align-items: center;
}

.bottombar .cont {
    display: flex;
    align-items: center;
    gap: 2px;
}

/* Color selection squares (leftmost in bottombar) */
.selection {
    width: 30px;
    height: 30px;
    background-image: repeating-linear-gradient(
        to left bottom,
        rgba(255,255,255,.8),
        rgba(255,255,255,.8) 1px,
        rgba(172,172,172,.02) 1px,
        rgba(128,128,128,.02) 2px
    );
    box-shadow: inset 1px 1px #808080,
                inset 2px 2px #000,
                1px 1px #fff;
    margin-right: 4px;
    position: relative;
    flex-shrink: 0;
}

.selected {
    position: absolute;
    width: 12px;
    height: 12px;
    top: 15%;
    left: 15%;
    border: 1px solid #d3d3d3;
    box-shadow: 1px 1px #232323, 1px 1px #fff;
    z-index: 1;
    cursor: pointer;
}

.selected2 {
    position: absolute;
    width: 12px;
    height: 12px;
    bottom: 15%;
    right: 15%;
    border: 1px solid #d3d3d3;
    box-shadow: 1px 1px #232323, 1px 1px #fff;
    cursor: pointer;
}

/* Color swatches */
.colors {
    display: grid;
    grid-template-columns: repeat(14, 15px);
    grid-template-rows: 15px 15px;
    gap: 0;
}

.color-swatch {
    margin: 1px;
    box-shadow: inset 1px 1px #808080,
                inset 2px 2px #000,
                1px 1px #fff;
    cursor: pointer;
}

.color-swatch:active {
    box-shadow: inset -1px -1px #808080,
                inset -2px -2px #000,
                -1px -1px #fff;
}

/* =========================================================
   BOTTOM INFO BAR
   ========================================================= */
.bottominfo {
    grid-area: 5 / 1 / 5 / -1;
    background-color: #c0c0c0;
    padding: 10px 10px;
    border-top: 1px solid #343434;
    box-shadow: inset 0px 1px #c0c0c0,
                inset 0px 2px #343434;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
}

.bottominfo .a {
    color: #000;
}

.bottominfo .footer-link {
    color: #000;
    text-decoration: underline;
    padding: 2px 3px;
    font-size: 11px;
    font-family: 'MS Sans Serif', 'Segoe UI', 'Tahoma', sans-serif;
    cursor: pointer;
    border: 1px solid transparent;
    position: relative;
}

.bottominfo .footer-link:hover {
    box-shadow: 1px 1px #000,
                inset -1px -1px #808080,
                inset 1px 1px #fff;
}

.bottominfo .footer-link:visited {
    color: #000;
}

.bottominfo .footer-link:active {
    box-shadow: inset 1px 1px #000,
                inset 2px 2px #808080,
                1px 1px #fff;
}

.bottominfo .b a {
    color: #000;
    text-decoration: none;
}

.bottominfo .b a:hover {
    text-decoration: underline;
}

/* =========================================================
   WINDOW TITLE BAR
   ========================================================= */
.site-header {
    display: none; /* We use the Paint grid instead */
}

/* =========================================================
   DESKTOP SIDEBAR
   ========================================================= */
.desktop-sidebar {
    display: none; /* We use the Paint grid instead */
}

/* =========================================================
   BOTTOM RIGHT RESIZE HANDLE
   ========================================================= */
.footer-resize {
    width: 16px;
    height: 14px;
    margin-left: auto;
    background:
        linear-gradient(135deg, #808080 25%, transparent 25%),
        linear-gradient(135deg, transparent 50%, #808080 50%, #808080 60%, transparent 60%);
    background-size: 4px 4px;
    cursor: se-resize;
    flex-shrink: 0;
}

/* =========================================================
   SCROLLBAR
   ========================================================= */
::-webkit-scrollbar {
    width: 16px;
    height: 16px;
}
::-webkit-scrollbar-track {
    background: #c0c0c0;
    border-left: 1px solid #808080;
}
::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #fff #808080 #808080 #fff;
}
::-webkit-scrollbar-button {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #fff #808080 #808080 #fff;
    height: 16px;
    width: 16px;
}
::-webkit-scrollbar-corner {
    background: #c0c0c0;
}

/* =========================================================
    POPUP GRID
    ========================================================= */
.popup-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.popup-row {
    display: flex;
    gap: 12px;
    width: 100%;
}

.popup-col {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    margin:auto;
    display:block;
}

.popup-col .pop-up {
    margin-bottom: 0;
}

/* =========================================================
    POP-UP
    ========================================================= */
.pop-up {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #fff #808080 #808080 #fff;
    padding: 0;
    margin-bottom: 16px;
    box-shadow: 1px 1px 0 0 #000;
    min-width: 50%;
}

.pop-up-titlebar {
    background: linear-gradient(90deg, #130080, #6200ff);
    color: #fff;
    margin: 3px;
    font-weight: bold;
    font-size: 15px;
    padding: 5px 8px;
    display: flex;
    align-items: center;
    user-select: none;
    gap: 4px;
    letter-spacing: 0.3px;
}

.pop-up-titlebar-text {
    flex: 1;
    text-align: left;
}

.pop-up-titlebar-btn {
    width: 16px;
    height: 14px;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #fff #808080 #808080 #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 7px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    color: #000;
    outline: none;
    font-family: 'Webdings', 'MS Sans Serif', sans-serif;
}

.pop-up-titlebar-btn:active {
    border-color: #808080 #fff #fff #808080;
}

.pop-up-body {
    padding: 12px 14px;
    background: #c0c0c0;
    font-size: 12px;
    line-height: 1.5;
    color: #000;
}

.pop-up-body strong {
    color: #800000;
}

.pop-up-body a {
    color: #0000ff;
}

/* =========================================================
   TYPOGRAPHY
   ========================================================= */
h1 {
    font-size: 20px;
    font-weight: bold;
    color: #000;
    margin: 0 0 8px 0;
}

h2 {
    font-size: 15px;
    font-weight: bold;
    color: #000;
    margin: 0 0 6px 0;
}

p {
    margin: 0 0 8px 0;
    line-height: 1.4;
    font-size: 13px;
}

a {
    color: #0000ff;
    text-decoration: underline;
    cursor: pointer;
}

a:visited {
    color: #800080;
}

.subtitle {
    font-size: 13px;
    color: #444;
    margin-top: -4px;
    margin-bottom: 10px;
}

/* =========================================================
   BUTTONS
   ========================================================= */
button {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #fff #808080 #808080 #fff;
    padding: 4px 12px;
    font-family: 'MS Sans Serif', 'Segoe UI', 'Tahoma', sans-serif;
    font-size: 11px;
    color: #000;
    cursor: pointer;
    outline: none;
}

button:active {
    border-color: #808080 #fff #fff #808080;
}

.btn {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #fff #808080 #808080 #fff;
    padding: 4px 12px;
    font-family: 'MS Sans Serif', 'Segoe UI', 'Tahoma', sans-serif;
    font-size: 11px;
    color: #000;
    cursor: pointer;
    outline: none;
    text-decoration: none;
    display: inline-block;
}

.btn:active {
    border-color: #808080 #fff #fff #808080;
}

.btn:visited {
    color: #000;
}

/* =========================================================
   ART GALLERY — 2-column masonry layout
   ========================================================= */
.art-grid {
    column-count: 2;
    column-gap: 16px;
}

.art-card.pop-up,
.art-card {
    margin-bottom: 3%;
    break-inside: avoid;
    display: inline-block;
    width: 100%;
    min-width: 0;
}

.art-card-body {
    padding: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.art-thumb {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: pointer;
    border: 2px solid;
    border-color: #808080 #fff #fff #808080;
    background: #7A7A7A;
}

.art-thumb:hover {
    border-color: #000080 #000080 #000080 #000080;
}

/* =========================================================
   ART EXPANDED OVERLAY — Full-screen image viewer
   ========================================================= */
.art-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.art-overlay-content {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #fff #808080 #808080 #fff;
    box-shadow: 2px 2px 0 0 #000;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    width: auto;
    height: auto;
    flex-shrink: 0;
}

.art-overlay-body {
    padding: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: auto;
}

.art-overlay-body img {
    display: block;
    max-width: 85vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border: 2px solid;
    border-color: #808080 #fff #fff #808080;
    background: #fff;
}

/* =========================================================
   INBOX — Full-size iframe inside a popup
   ========================================================= */
.inbox-popup {
    width: 100%;
    margin-bottom: 0;
}

.inbox-body {
    padding: 0;
    overflow: hidden;
}

.inbox-iframe {
    padding:10px;
    width: 100%;
    height: 70vh;
    border: none;
    display: block;
}

/* Hide original layout.js elements */
.site-footer {
    display: none;
}

/* =========================================================
   GUESTBOOK
   ========================================================= */
.guestbook-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.guestbook-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.guestbook-field label {
    font-size: 12px;
    font-weight: bold;
    color: #000;
}

.guestbook-field input,
.guestbook-field textarea {
    background: #fff;
    border: 2px solid;
    border-color: #808080 #fff #fff #808080;
    padding: 4px 6px;
    font-family: 'MS Sans Serif', 'Segoe UI', 'Tahoma', sans-serif;
    font-size: 12px;
    color: #000;
    outline: none;
}

.guestbook-field input:focus,
.guestbook-field textarea:focus {
    border-color: #000080 #000080 #000080 #000080;
}

.guestbook-field textarea {
    resize: vertical;
    min-height: 60px;
}

.guestbook-submit {
    align-self: flex-start;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #fff #808080 #808080 #fff;
    padding: 4px 20px;
    font-family: 'MS Sans Serif', 'Segoe UI', 'Tahoma', sans-serif;
    font-size: 11px;
    color: #000;
    cursor: pointer;
    outline: none;
}

.guestbook-submit:active {
    border-color: #808080 #fff #fff #808080;
}

.guestbook-submit:disabled {
    color: #808080;
}

/* Form messages (thank you / error) */
.guestbook-msg {
    font-size: 12px;
    padding: 6px 8px;
    border: 2px solid;
}

.guestbook-msg-success {
    background: #c0ffc0;
    border-color: #00aa00 #005500 #005500 #00aa00;
    color: #003300;
}

.guestbook-msg-error {
    background: #ffc0c0;
    border-color: #aa0000 #550000 #550000 #aa0000;
    color: #330000;
}

/* Guestbook comment container (not a popup) */
.guestbook-comment {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #fff #808080 #808080 #fff;
    padding: 0;
    margin-bottom: 16px;
    margin-right: 32px;
    box-shadow: 1px 1px 0 0 #000;
}

/* Guestbook comment titlebar — navy gradient like pop-ups */
.guestbook-comment-titlebar {
    background: linear-gradient(90deg, #130080, #6200ff);
    color: #fff;
    margin: 3px;
    font-weight: bold;
    font-size: 15px;
    padding: 5px 8px;
    display: flex;
    align-items: center;
    user-select: none;
    letter-spacing: 0.3px;
}

.guestbook-comment-titlebar-text {
    flex: 1;
    text-align: left;
}

/* Guestbook comment body */
.guestbook-comment-body {
    padding: 12px 14px;
    background: #c0c0c0;
    font-size: 12px;
    line-height: 1.5;
    color: #000;
}

/* Guestbook comment date */
.guestbook-comment-date {
    font-size: 10px;
    color: #808080;
    display: block;
    margin-bottom: 4px;
}

/* Guestbook comment image (preserved for future use) */
.guestbook-comment-img {
    max-width: 200px;
    max-height: 200px;
    display: block;
    margin-top: 6px;
    border: 2px solid;
    border-color: #808080 #fff #fff #808080;
    object-fit: contain;
}

/* Reply popup — indented sibling, below its comment */
.guestbook-reply-popup {
    margin-left: 24px;
    margin-top: -5px;
    margin-bottom: 16px;
}

/* Pagination */
.guestbook-page-info {
    font-size: 11px;
    color: #000;
    margin-right: 8px;
}

.guestbook-page-btn {
    background: #c0c0c0;
    border: 2px solid;
    border-color: #fff #808080 #808080 #fff;
    padding: 2px 8px;
    font-family: 'MS Sans Serif', 'Segoe UI', 'Tahoma', sans-serif;
    font-size: 11px;
    color: #000;
    cursor: pointer;
    outline: none;
    margin: 0 1px;
}

.guestbook-page-btn:active {
    border-color: #808080 #fff #fff #808080;
}

.guestbook-page-btn:disabled {
    color: #808080;
    cursor: default;
}

.guestbook-page-active {
    font-weight: bold;
    background: #e0e0e0;
    border-color: #808080 #fff #fff #808080;
}

.guestbook-page-ellipsis {
    font-size: 11px;
    color: #000;
    padding: 0 4px;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
  .character-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

  .art-grid {
    column-count: 1;
  }

  .art-grid .pop-up {
    min-width: 0;
  }
}

@media (max-width: 820px) {
    .sidebar {
        display: none;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .canvas {
        grid-column: 1 / -1;
    }

    .bottombar {
        grid-column: 1 / -1;
    }

    .bottominfo {
        grid-column: 1 / -1;
    }

    .colors {
        grid-template-columns: repeat(14, 15px);
        grid-template-rows: 15px 15px;
    }

    .upbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .upbar-left,
    .upbar-right {
        flex-wrap: wrap;
    }

    .popup-row {
        flex-direction: column;
    }

    .popup-col {
        flex: 1 1 auto;
        width: 100%;
    }
}

