@import url('https://fonts.googleapis.com/css2?family=Pixelify+Sans:wght@400;500;600&display=swap');

*{
margin:0;
padding:0;
box-sizing:border-box;
}

body{
background:#e9dfcf;
color:#232323;
font-family:'Pixelify Sans',sans-serif;
}

header{

position:fixed;

top:0;

left:0;

width:100%;

background:#f8f1e3;

padding:22px 40px;

display:flex;

justify-content:space-between;

align-items:center;

z-index:999;

border-bottom:2px solid rgba(0,0,0,.1);

}

.hideHeader{

transform:translateY(-120%);

opacity:0;

pointer-events:none;

}

.site-name{
display:flex;
align-items:center;
text-decoration:none;
flex-shrink:0;
}

.site-name img{
display:block;height:58px;
width:auto;
max-width:min(420px,45vw);
object-fit:contain;
transform:scale(1.05);
transform-origin:left center;
position:relative;
top:7px;
}

.site-name:hover img{
transform:scale(1.10);
}

.site-name img{
transition:transform .18s ease;
}

nav{

display:flex;

gap:16px;

}

nav a{

background:#f2e6d2;

padding:12px 20px;

border-radius:14px;

text-decoration:none;

color:#232323;

font-size:22px;

transition:.18s;

}

nav a:hover{

background:#dbc2a1;

transform:

translateY(-3px)

scale(1.06);

box-shadow:

0 8px 18px rgba(0,0,0,.14);

}

.home{

padding:

150px

60px

80px;

text-align:center;

}

.home h1{

font-size:52px;

margin-bottom:50px;

line-height:1.2;

}

.preview{

width:760px;

max-width:90%;

background:white;

padding:18px;

cursor:pointer;

border-radius:6px;

transform:

rotate(-1deg);

transition:.22s;

box-shadow:

0 10px 35px rgba(0,0,0,.15);

}

.preview:hover{

transform:

rotate(1.5deg)

scale(1.045);

box-shadow:

0 22px 50px rgba(0,0,0,.18);

}

.home p{

margin:

60px auto;

max-width:950px;

font-size:25px;

line-height:1.9;

background:

#fff9ef;

padding:42px;

border-radius:22px;

color:#2b2b2b;

box-shadow:

0 10px 28px rgba(0,0,0,.08);

}

#viewer{

width:100vw;

height:100vh;

padding-top:90px;

overflow:auto;

display:flex;

justify-content:center;

align-items:center;

background:

linear-gradient(

180deg,

#ece3d3,

#ddd2be

);

}

#viewer.fullscreenMode{

padding-top:0;

}

#zoomContainer{

padding:60px;

}

#poster{

display:block;

max-width:100vw;

max-height:82vh;

background:white;

padding:20px;

box-shadow:

0 12px 40px rgba(0,0,0,.18);

}

.hotspot{

position:absolute;

}

#zoomButtons{

position:fixed;

right:25px;

bottom:25px;

display:flex;

gap:10px;

}

#zoomButtons button{

width:62px;

height:62px;

font-size:30px;

border:none;

background:#fff7eb;

border-radius:18px;

font-family:'Pixelify Sans';

cursor:pointer;

transition:.18s;

box-shadow:

0 5px 20px rgba(0,0,0,.12);

}

#zoomButtons button:hover{

background:#d7b68c;

transform:

translateY(-3px)

scale(1.08);

}

.credits{

padding:

170px

80px

100px;

text-align:center;

}

.credits h1{

font-size:60px;

margin-bottom:50px;

}

.credits>p{

max-width:950px;

margin:

0 auto

90px;

font-size:28px;

line-height:2;

background:#fff8ee;

padding:42px;

color:#232323;

border-radius:24px;

box-shadow:

0 10px 30px rgba(0,0,0,.08);

}

.credit-list{

display:grid;

grid-template-columns:

repeat(

auto-fit,

minmax(

320px,

1fr

)

);

gap:70px;

max-width:1200px;

margin:auto;

}

.credit{

background:#fff8ee;

padding:42px;

border-radius:20px;

text-align:left;

transform:

rotate(-1deg);

transition:.2s;

box-shadow:

0 12px 28px rgba(0,0,0,.12);

}

.credit:nth-child(even){

transform:

rotate(1deg);

}

.credit:hover{

transform:

rotate(0deg)

scale(1.06);

box-shadow:

0 22px 45px rgba(0,0,0,.18);

}

.credit a{

display:block;

font-size:34px;

margin-bottom:24px;

text-decoration:none;

color:#232323;

transition:.15s;

}

.credit:hover a{

color:#8f6b44;

}

.credit p{

font-size:25px;

line-height:2;

color:#444;

}

@media(max-width:900px){

header{

padding:18px;

flex-direction:column;

}

.site-name img{
height:44px;
max-width:70vw;
}

nav a{

font-size:18px;

}

.home{

padding:

140px

30px

50px;

}

.home h1{

font-size:34px;

}

.home p{

font-size:20px;

}

.credits{

padding:

150px

30px

60px;

}

.credit-list{

grid-template-columns:1fr;

gap:45px;

}

.credit{

padding:28px;

}

.credit a{

font-size:28px;

}

.credit p{

font-size:20px;

}

}

#viewer {
    position: relative;
    width: 100vw;
    height: 100vh;
    padding-top: 90px;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(180deg, #ece3d3, #ddd2be);
    cursor: grab;
}

#viewer.dragging { cursor: grabbing; }
#viewer.fullscreenMode { padding-top: 0; }

#zoomStage {
    position: relative;
    flex-shrink: 0;
}

#zoomContainer {
    position: relative;
    padding: 60px;
    transform-origin: top left;
}

#posterFrame {
    display: inline-block;
    padding: 20px;
    background: white;
    box-shadow: 0 12px 40px rgba(0,0,0,.18);
}

#posterCanvas {
    position: relative;
    display: block;
    width: fit-content;
    line-height: 0;
}

#poster {
    display: block;
    max-width: 100vw;
    max-height: 82vh;
    width: auto;
    height: auto;
    padding: 0;
    background: transparent;
    box-shadow: none;
    user-select: none;
    pointer-events: none;
}

#characterHotspots {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.character-hotspot {
    position: absolute;
    background: transparent;
    border: 0;
    outline: 0;
    box-shadow: none;
    pointer-events: auto;
}

.character-hotspot::before,
.character-hotspot::after,
.character-hotspot:hover::before,
.character-hotspot:hover::after,
.character-hotspot.hovered::before,
.character-hotspot.hovered::after,
.character-hotspot.selected::before,
.character-hotspot.selected::after {
    content: none !important;
    display: none !important;
    border: 0 !important;
    outline: 0 !important;
    background: none !important;
    box-shadow: none !important;
}

.character-marker,
.character-name {
    display: none !important;
}

.character-name-label {
    position: absolute;
    display: block;
    padding: 10px 16px;
    border: 3px solid white;
    border-radius: 12px;
    background: rgba(35,35,35,.93);
    color: white;
    font-family: inherit;
    font-size: 18px;
    white-space: nowrap;
    text-decoration: none;
    opacity: 0;
    transform: translate(-50%,-50%) translateY(8px) scale(.9);
    transition: opacity .18s ease, transform .18s ease, background .18s ease, box-shadow .18s ease;
    pointer-events: none;
    box-shadow: 0 7px 20px rgba(0,0,0,.35);
    z-index: 20;
}

.character-hotspot:hover .character-name-label,
.character-hotspot.hovered .character-name-label,
.character-hotspot.selected .character-name-label {
    opacity: 1;
    transform: translate(-50%,-50%) scale(1);
    pointer-events: auto;
}

.character-name-label:hover {
    background: #8f6b44;
    transform: translate(-50%,-50%) translateY(-2px) scale(1.06);
    box-shadow: 0 10px 25px rgba(0,0,0,.4);
}

body.edit-mode .character-hotspot {
    border: 3px dashed rgba(255,255,255,.95);
    background: rgba(255,230,140,.13);
    cursor: move;
}

body.edit-mode .character-hotspot.selected {
    border-style: solid;
    border-color: #ffed9f;
    background: rgba(255,237,159,.2);
}

body.edit-mode .character-name-label {
    opacity: 1;
    pointer-events: auto;
    cursor: grab;
    transform: translate(-50%,-50%) scale(1);
}

.resize-handle {
    position: absolute;
    right: -10px;
    bottom: -10px;
    width: 22px;
    height: 22px;
    display: none;
    border: 3px solid white;
    border-radius: 5px;
    background: #232323;
    cursor: nwse-resize;
    z-index: 30;
}

body.edit-mode .character-hotspot.selected .resize-handle { display: block; }

#pageTools {
    position: fixed;
    top: 115px;
    right: 25px;
    z-index: 1200;
    display: flex;
    gap: 10px;
}

.page-tool-button {
    padding: 13px 18px;
    border: none;
    border-radius: 14px;
    background: #232323;
    color: white;
    font-family: inherit;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,0,0,.24);
}

.page-tool-button:hover { background: #8f6b44; }
#editModeButton.active { background: #b37439; }
#exportButton { display: none; }
body.edit-mode #exportButton { display: block; }

#characterMenuBackdrop,
#exportBackdrop {
    position: fixed;
    inset: 0;
    z-index: 1290;
    background: rgba(20,20,20,.48);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}

#characterMenuBackdrop.open,
#exportBackdrop.open {
    opacity: 1;
    visibility: visible;
}

#characterMenu {
    position: fixed;
    top: 0;
    right: 0;
    width: 360px;
    max-width: 92vw;
    height: 100vh;
    z-index: 1300;
    display: flex;
    flex-direction: column;
    padding: 26px;
    background: #fff8ee;
    border-left: 3px solid rgba(0,0,0,.12);
    box-shadow: -12px 0 35px rgba(0,0,0,.25);
    transform: translateX(105%);
    transition: transform .25s ease;
}

#characterMenu.open { transform: translateX(0); }

.menu-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.menu-top h2 { margin: 0; font-size: 32px; }

.close-menu-button {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border: none;
    border-radius: 12px;
    background: #232323;
    color: white;
    font-family: inherit;
    font-size: 27px;
    cursor: pointer;
}

.close-menu-button:hover { background: #8f6b44; }

#characterSearch {
    width: 100%;
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 2px solid #d4b991;
    border-radius: 11px;
    background: white;
    font-family: inherit;
    font-size: 18px;
}

#characterList {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding-right: 6px;
}

.character-list-button {
    width: 100%;
    padding: 13px 14px;
    border: 2px solid transparent;
    border-radius: 11px;
    background: #f0e2cf;
    color: #232323;
    text-align: left;
    font-family: inherit;
    font-size: 19px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.character-list-button:hover,
.character-list-button.hovered {
    background: #e3cfb4;
    transform: translateX(4px);
}

.character-list-button.selected {
    border-color: #8f6b44;
    background: #d7b68c;
}

#selectedCharacterSection {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 2px solid rgba(0,0,0,.12);
}

#selectedCharacterName {
    display: block;
    margin: 7px 0 14px;
    font-size: 24px;
}

#viewCharacterButton {
    display: block;
    width: 100%;
    padding: 13px;
    border-radius: 11px;
    background: #232323;
    color: white;
    text-align: center;
    text-decoration: none;
    pointer-events: none;
    opacity: .5;
}

#viewCharacterButton.ready { pointer-events: auto; opacity: 1; }
#viewCharacterButton.ready:hover { background: #8f6b44; }

#exportWindow {
    position: fixed;
    top: 50%;
    left: 50%;
    width: min(750px,92vw);
    max-height: 88vh;
    z-index: 1400;
    padding: 25px;
    background: #fff8ee;
    border-radius: 20px;
    box-shadow: 0 18px 50px rgba(0,0,0,.35);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%,-46%) scale(.96);
    transition: opacity .2s ease, visibility .2s ease, transform .2s ease;
}

#exportWindow.open {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%,-50%) scale(1);
}

#exportCode {
    width: 100%;
    min-height: 420px;
    margin-top: 16px;
    padding: 16px;
    border: 2px solid #d4b991;
    border-radius: 12px;
    background: #232323;
    color: #fff8ee;
    font-family: Consolas, monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
}

#zoomButtons {
    position: fixed;
    right: 25px;
    bottom: 25px;
    z-index: 1100;
    display: flex;
    gap: 10px;
}

#zoomButtons button {
    width: 62px;
    height: 62px;
    border: none;
    border-radius: 18px;
    background: #fff7eb;
    font-family: inherit;
    font-size: 30px;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0,0,0,.16);
}

#zoomButtons button:hover { background: #d7b68c; }

.character-page {
    width: min(1250px,100%);
    margin: auto;
    padding: 145px 45px 90px;
}

.character-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 35px;
}

.back-to-poster,
.character-cycle-button {
    display: inline-block;
    padding: 12px 18px;
    border-radius: 12px;
    background: #fff8ee;
    color: #232323;
    text-decoration: none;
    font-size: 19px;
    box-shadow: 0 6px 18px rgba(0,0,0,.1);
    transition: transform .18s ease, background .18s ease;
}

.back-to-poster:hover,
.character-cycle-button:hover {
    background: #dbc2a1;
    transform: translateY(-2px);
}

.character-cycle { display: flex; gap: 10px; }
.character-cycle-button.disabled { opacity: .4; pointer-events: none; }

.character-profile {
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(360px,520px);
    align-items: center;
    gap: 70px;
    padding: 55px;
    background: #fff8ee;
    border-radius: 28px;
    box-shadow: 0 18px 45px rgba(0,0,0,.13);
}

.character-information { text-align: left; }
.character-eyebrow { margin-bottom: 12px; color: #8f6b44; font-size: 19px; letter-spacing: 1px; text-transform: uppercase; }
.character-information h1 { margin-bottom: 22px; font-size: clamp(48px,7vw,78px); line-height: .95; color: #232323; }
.character-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 35px; }
.character-tag { display: inline-block; padding: 10px 15px; border: 2px solid rgba(143,107,68,.25); border-radius: 999px; background: #f0e2cf; color: #4d3b2b; font-size: 18px; }
.character-description { padding-top: 28px; border-top: 2px solid rgba(0,0,0,.1); }
.character-description p { margin-bottom: 20px; color: #3c3c3c; font-size: 21px; line-height: 1.75; }
.character-description h2 { margin: 28px 0 12px; font-size: 27px; }
.character-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.character-links a { display: inline-block; padding: 13px 20px; border-radius: 12px; background: #232323; color: white; text-decoration: none; font-size: 19px; transition: transform .18s ease, background .18s ease; }
.character-links a:hover { background: #8f6b44; transform: translateY(-2px); }
.character-art-section { position: relative; text-align: center; }
.character-art-frame { position: relative; padding: 18px; background: white; border-radius: 8px; transform: rotate(1.5deg); box-shadow: 0 18px 40px rgba(0,0,0,.2); transition: transform .25s ease; }
.character-art-frame:hover { transform: rotate(0deg) translateY(-5px); }
.character-art { display: block; width: 100%; max-height: 650px; object-fit: contain; background: #eee4d4; }
.character-art-caption { margin-top: 18px; color: #72583d; font-size: 20px; }
.character-error { max-width: 750px; margin: 50px auto; padding: 45px; background: #fff8ee; border-radius: 24px; text-align: center; box-shadow: 0 15px 40px rgba(0,0,0,.12); }
.character-error h1 { margin-bottom: 20px; font-size: 48px; }
.character-error p { margin-bottom: 25px; font-size: 21px; line-height: 1.6; }
.character-error a { display: inline-block; padding: 13px 20px; border-radius: 12px; background: #232323; color: white; text-decoration: none; font-size: 19px; }

@media(max-width:900px) {
    #pageTools { top: auto; right: 15px; bottom: 105px; flex-direction: column; }
    .page-tool-button { font-size: 15px; }
    .character-name-label { padding: 8px 12px; font-size: 14px; }
    .character-page { padding: 150px 20px 60px; }
    .character-navigation { align-items: stretch; flex-direction: column; }
    .character-cycle { display: grid; grid-template-columns: 1fr 1fr; }
    .character-cycle-button, .back-to-poster { text-align: center; }
    .character-profile { grid-template-columns: 1fr; gap: 45px; padding: 30px; }
    .character-information h1 { font-size: 48px; }
    .character-description p { font-size: 18px; }
    .character-art-section { grid-row: 1; }
}

@media(max-width:500px) {
    .character-profile { padding: 20px; border-radius: 18px; }
    .character-information h1 { font-size: 40px; }
    .character-tags { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 700px) {
    header {
        min-height: 64px;
        padding: 6px 12px;
        gap: 8px;
    }

    .site-name {
        max-width: 145px;
    }

    .site-name img {
        height: 32px;
        max-width: 145px;
        transform: none !important;
        top: 0 !important;
    }

    nav {
        gap: 6px;
    }

    nav a {
        padding: 9px 12px;
        font-size: 14px;
        border-radius: 10px;
    }

    .home {
        padding-top: 92px;
    }

    .home-logo-title {
        margin-bottom: 18px;
    }

    .home-logo-title img {
        width: min(390px, 76vw) !important;
        max-width: 76vw !important;
    }

    .preview {
        width: min(520px, 82vw);
        margin-top: 18px;
    }

    .home p {
        width: min(520px, 88vw);
        margin-top: 42px;
        padding: 24px 20px;
        font-size: 17px;
        line-height: 1.55;
        border-radius: 22px;
    }
}