@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Plus+Jakarta+Sans:wght@400;600;700;800&family=VT323&display=swap');

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

body {
    background-color: #0d0f18;
    color: #e2e8f0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Header */
.ofis-header {
    background: rgba(13, 15, 24, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    font-family: 'Press Start 2P', monospace;
    font-size: 13px;
    font-weight: 700;
    color: #38bdf8;
    text-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.brand-badge {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #7dd3fc;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 999px;
    font-family: 'VT323', monospace;
    letter-spacing: 1px;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #4ade80;
    font-weight: 600;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #4ade80;
    border-radius: 50%;
    box-shadow: 0 0 10px #4ade80;
    animation: pulse 1.6s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.8; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.8; }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-header {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn-header:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: #38bdf8;
    color: #38bdf8;
}

/* Canvas Viewport */
.game-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 16px;
    overflow: hidden;
}

.canvas-wrapper {
    position: relative;
    border-radius: 0;
    border: none;
    box-shadow: none;
    background: #15151d;
    overflow: hidden;
    cursor: crosshair;
}

canvas#officeCanvas {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    display: block;
    image-rendering: auto;
    
}

/* Quick Bar / Hint */
.instruction-bar {
    margin-top: 12px;
    font-size: 12px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 16px;
    font-family: 'VT323', monospace;
    font-size: 16px;
    letter-spacing: 0.5px;
}

.instruction-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Speech Bubble Over Canvas */
.speech-bubble {
    position: absolute;
    transform: translate(-50%, -100%);
    background: #ffffff;
    color: #0f172a;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    width: max-content;
    max-width: min(280px, calc(100vw - 32px));
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    text-align: left;
    pointer-events: none;
    box-shadow: 0 4px 14px rgba(0,0,0,0.4);
    z-index: 50;
    transition: opacity 0.2s ease;
    border: 2px solid #0f172a;
    font-family: 'Plus Jakarta Sans', sans-serif;
    line-height: 1.3;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: #0f172a transparent;
    display: block;
    width: 0;
}

/* Room Indicator Badge */
.room-badge {
    position: absolute;
    padding: 3px 8px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #38bdf8;
    font-family: 'VT323', monospace;
    font-size: 13px;
    border-radius: 4px;
    pointer-events: none;
    letter-spacing: 1px;
}

/* Service Detail Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: #111422;
    border: 1px solid rgba(56, 189, 248, 0.3);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(56, 189, 248, 0.15);
    border-radius: 16px;
    width: 100%;
    max-width: 960px;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.25s ease;
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

.modal-header {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(129, 140, 248, 0.1));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-icon {
    font-size: 24px;
}

.modal-title {
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
}

.modal-subtitle {
    font-size: 12px;
    color: #94a3b8;
}

.modal-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    border-radius: 6px;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #f1f5f9;
}

.modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-desc {
    font-size: 14px;
    line-height: 1.6;
    color: #cbd5e1;
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.feature-bullet {
    color: #38bdf8;
    font-weight: bold;
}

.modal-footer {
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.btn-cta {
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
    text-decoration: none;
    transition: all 0.2s;
}

.btn-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.6);
}

.btn-secondary {
    background: transparent;
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.btn-secondary:hover {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

/* Kantan.Game Style Retro Pixel Zoom Controls */
.knt-zoom-controls {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: flex;
    gap: 4px;
    z-index: 60;
    user-select: none;
}

.knt-zoom-controls button {
    width: 28px;
    height: 28px;
    background: rgba(10, 10, 15, 0.85);
    border: 1px solid #3f3f46;
    color: #e4e4e7;
    font-family: "VT323", monospace;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6);
    transition: all 0.15s ease;
}

.knt-zoom-controls button:hover:not(.is-disabled) {
    background: #1e293b;
    border-color: #38bdf8;
    color: #38bdf8;
}

.knt-zoom-controls button.is-on {
    border-color: #fde68a;
    color: #fde68a;
}

.knt-zoom-controls button.is-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    border-color: #27272a;
}


/* ==========================================
   MOBİL, RESPONSIVE & YATAY TAM EKRAN DÜZENİ
   ========================================== */

/* Mobil Responsive İyileştirmeleri */
@media (max-width: 768px) {
    .ofis-header {
        padding: 8px 12px;
    }
    .brand-logo {
        font-size: 11px;
    }
    .brand-badge {
        display: none;
    }
    .live-indicator {
        font-size: 10px;
    }
    .btn-header {
        padding: 4px 8px;
        font-size: 11px;
    }
    .game-container {
        padding: 4px;
    }
    .instruction-bar {
        font-size: 13px;
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* Standart Canvas Alanı */
.canvas-wrapper {
    width: 100%;
    max-width: 960px;
    aspect-ratio: 688 / 464;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0d0f18;
    position: relative;
    overflow: hidden;
}

canvas#officeCanvas {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    display: block;
    image-rendering: auto;
    
}

#speechOverlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 50;
}

/* ==========================================
   TAM EKRAN (FULLSCREEN) & YATAY EKRANI KAPLAMA
   ========================================== */
.canvas-wrapper:fullscreen,
.canvas-wrapper:-webkit-full-screen,
body.is-fullscreen-fallback .canvas-wrapper {
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    background: #0d0f18 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 999999 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.canvas-wrapper:fullscreen canvas#officeCanvas,
.canvas-wrapper:-webkit-full-screen canvas#officeCanvas,
body.is-fullscreen-fallback .canvas-wrapper canvas#officeCanvas {
    width: 100% !important;
    height: 100% !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    min-height: 0 !important;
    object-fit: contain !important;
    margin: auto !important;
}

/* Dikey Mobil Cihazda Tam Ekrana Geçildiğinde Otomatik Yataya Döndürme Fallback */
@media (max-width: 1024px) and (orientation: portrait) {
    .canvas-wrapper:fullscreen,
    .canvas-wrapper:-webkit-full-screen,
    body.is-fullscreen-fallback .canvas-wrapper {
        transform: rotate(90deg);
        transform-origin: center center;
        width: 100vh !important;
        height: 100vw !important;
        top: calc((100vh - 100vw) / 2) !important;
        left: calc((100vw - 100vh) / 2) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    .canvas-wrapper:fullscreen canvas#officeCanvas,
    .canvas-wrapper:-webkit-full-screen canvas#officeCanvas,
    body.is-fullscreen-fallback .canvas-wrapper canvas#officeCanvas {
        width: 100% !important;
        height: 100% !important;
        max-width: 100vh !important;
        max-height: 100vw !important;
        object-fit: contain !important;
    }
}

.canvas-wrapper:fullscreen .knt-zoom-controls,
.canvas-wrapper:-webkit-full-screen .knt-zoom-controls,
body.is-fullscreen-fallback .knt-zoom-controls {
    bottom: 20px;
    right: 20px;
    z-index: 9999999;
}







/* ==========================================
   PURE OFFICE & SAĞ KARAKTER LİSTESİ DÜZENİ
   ========================================== */
html, body.pure-office-mode {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #090b12;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: #f8fafc;
}

.office-main-layout {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: row;
    overflow: hidden;
}

/* Embed Modu: İframe veya önizleme pencerelerinde yan paneli ve HUD butonlarını gizleyip sadece ofis tuvalini %100 odaklar */
html.is-embed body .character-sidebar,
html.is-embed body .knt-zoom-controls,
body.is-embed .character-sidebar,
body.is-embed .knt-zoom-controls {
    display: none !important;
}
html.is-embed body .office-canvas-zone,
body.is-embed .office-canvas-zone {
    width: 100vw !important;
    height: 100vh !important;
    flex: 1 1 100% !important;
}

/* Sol/Orta Alan: Sadece Ofis Canvası */
.office-canvas-zone {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #090b12;
    position: relative;
    overflow: hidden;
    padding: 0;
    box-sizing: border-box;
}

.office-canvas-zone .canvas-wrapper {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    aspect-ratio: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
}

.office-canvas-zone canvas#officeCanvas {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    /* Maksimum piksel keskinliği (sıfır bulanıklık): */
    image-rendering: -moz-crisp-edges !important;
    image-rendering: -webkit-crisp-edges !important;
    image-rendering: pixelated !important;
    image-rendering: crisp-edges !important;
    box-shadow: none;
    border-radius: 0;
    border: none;
}

/* Sağ Taraf: Karakter & Hizmet Paneli */
.character-sidebar {
    width: 250px;
    height: 100%;
    background: #0d111c;
    border-left: 2px solid #1e293b;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    z-index: 40;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.4);
}

.sidebar-header {
    padding: 14px 16px;
    background: #0f172a;
    border-bottom: 2px solid #1e293b;
}

.sidebar-title-badge {
    font-family: 'VT323', monospace;
    font-size: 17px;
    font-weight: 700;
    color: #38bdf8;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.sidebar-subtitle {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

.char-list-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Scrollbar özelleştirmesi */
.char-list-scroll::-webkit-scrollbar {
    width: 6px;
}
.char-list-scroll::-webkit-scrollbar-track {
    background: #090b12;
}
.char-list-scroll::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 3px;
}

.char-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    background: rgba(30, 41, 59, 0.45);
    border: 1px solid #1e293b;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.char-item:hover {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.4);
    transform: translateX(-2px);
}

.char-item.is-active {
    background: rgba(56, 189, 248, 0.2);
    border-color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.char-avatar {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #0f172a;
    border: 2px solid #38bdf8;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.char-avatar img {
    width: 32px;
    height: 64px;
    object-fit: none;
    object-position: 0 0;
    image-rendering: pixelated;
}

.char-info {
    flex: 1;
    min-width: 0;
}

.char-name {
    font-family: 'VT323', monospace;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.char-role {
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.char-track-icon {
    font-size: 14px;
    opacity: 0.4;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.char-item:hover .char-track-icon,
.char-item.is-active .char-track-icon {
    opacity: 1;
}

.sidebar-footer {
    padding: 12px;
    background: #0f172a;
    border-top: 2px solid #1e293b;
}

.btn-sidebar-cta {
    display: block;
    text-align: center;
    padding: 10px 14px;
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: #ffffff;
    font-weight: 700;
    font-size: 13px;
    border-radius: 6px;
    text-decoration: none;
    border: 1px solid #38bdf8;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
    transition: all 0.2s ease;
}

.btn-sidebar-cta:hover {
    background: linear-gradient(135deg, #0369a1, #075985);
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.4);
    transform: translateY(-1px);
}

/* Mobil / Dar Ekranlar: Panel altta drawer veya floating olur */
@media (max-width: 860px) {
    .office-main-layout {
        flex-direction: column;
    }
    .office-canvas-zone {
        flex: 1;
        height: 65%;
    }
    .character-sidebar {
        width: 100%;
        height: 35%;
        border-left: none;
        border-top: 2px solid #1e293b;
    }
}
