@import url('https://fonts.googleapis.com/css2?family=Xanh+Mono:ital@0;1&display=swap');

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

body {
    padding: 2rem;
    margin: 0;
    font-family: "Xanh Mono", sans-serif;
    font-weight: 700;
    background: #AECBEB;
    border: 2px solid #4893C6;
    color: #1d2d44;
    text-transform: lowercase;
    height: 100vh;
    font-size: 75%;
}

::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: #AECBEB;
    border: 1px solid #1d2d44;
}

::-webkit-scrollbar-thumb {
    background: #4893C6;
    border: 1px solid #1d2d44;
}

::-webkit-scrollbar-thumb:hover {
    background: #1d2d44;
}

#columnWrapper {
    width: 100%;
    height: 100%;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.column {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.container-styles {
    border: 3px inset #1d2d44;
    padding: 8px;
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #AECBEB;
}

#minimap {
    font-family: "Xanh Mono", monospace;
    font-size: 8px;
    line-height: 1.2;
    user-select: none;
}

.minimap-row {
    display: flex;
}

.minimap-cell {
    width: 34px;
    height: 24px;
    border: 1px solid #1d2d44;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4893C6;
    text-transform: lowercase;
    box-sizing: border-box;
}

.minimap-current {
    background: #1d2d44;
    color: #AECBEB;
    border-color: #4893C6;
}

#eyes {
    height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.eyes-title {
    font-size: 1.5em;
    font-weight: bold;
    color: #1d2d44;
    margin-bottom: 10px;
    text-align: center;
    user-select: none;
}

.eyes-instructions {
    font-size: 0.9em;
    font-weight: normal;
    line-height: 1.4em;
    color: #1d2d44;
    text-align: center;
    user-select: none;
}

.eyes-instructions p {
    margin: 0 0 8px 0;
}

#workspace {
    height: 400px;
    overflow-y: auto;
}

#gridInfo {
    height: 320px;
    font-weight: bold;
    overflow-y: auto;
    user-select: none;
}

#investigator {
    height: 360px;
    overflow: auto;
}

.extracted-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #4893C6;
}

.extracted-section-title {
    font-weight: bold;
    color: #4893C6;
    margin-bottom: 5px;
    user-select: none;
}

.extracted-section-title-clickable {
    cursor: pointer;
}

.extracted-section-title-clickable:hover {
    background: rgba(72, 147, 198, 0.2);
}

.extracted-item-link {
    cursor: pointer;
    padding: 3px 0;
    font-size: 0.9em;
    user-select: none;
}

.extracted-item-link:hover {
    color: #4893C6;
    background: rgba(72, 147, 198, 0.2);
}

#allExtracted {
    font-style: italic;
    color: #4893C6;
    display: flex;
    align-items: center;
}

#itemsContainer {
    max-height: 240px;
    overflow-y: auto;
    font-size: 0.8em;
    font-weight: normal;
    line-height: 1.2em;
    border: 1px solid #1d2d44;
    background: #AECBEB;
}

.itemDiv {
    padding: 8px;
    border-bottom: 1px solid #1d2d44;
    white-space: pre-wrap;
    word-break: break-word;
    cursor: pointer;
    transition: background-color 0.2s ease;
    user-select: none;
}

.itemDiv:hover {
    background-color: #4893C6;
    color: #AECBEB;
}

.item-image {
    max-width: 100%;
    max-height: 200px;
    display: block;
    object-fit: contain;
}

.itemTitle {
    margin-bottom: 10px;
    font-size: 1.1em;
    font-weight: bold;
    color: #1d2d44;
    user-select: none;
}

#itemContent {
    max-height: 250px;
    overflow-y: auto;
    font-size: 1em;
    line-height: 1.2em;
    word-break: break-word;
    border: 1px solid #1d2d44;
    background: #AECBEB;

    padding: 8px;
}

.investigatorImage {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    margin: 0;
    border: 2px solid #1d2d44;
}

.investigatorNoImage {
    font-style: italic;
    color: #4893C6;
}

.investigatorText {
    font-weight: normal;
    white-space: pre-wrap;
}

.investigatorURL {
    margin-top: 8px;
    font-size: 0.85em;
}

.investigatorURL a {
    text-decoration: none;
    color: #4893C6;
    word-break: break-all;
}

.investigatorURL a:hover {
    text-decoration: underline;
}

.buttonContainer {
    padding: 8px;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}



.button {
    padding: 3px 10px;
    border: 2px solid #4893C6;
    cursor: pointer;
    user-select: none;
    max-width: fit-content;
    font-family: "Xanh Mono", sans-serif;
    font-size: 12px;
    background: #AECBEB;
    color: #1d2d44;
    transition: all 0.2s;
}

.button:hover {
    background: #4893C6;
    color: #AECBEB;
}


#viewportContainer {
    width: 320px;
    height: 320px;
    border: 3px inset #1d2d44;
    overflow: hidden;
    position: relative;
    background: #AECBEB;
}

.copyBox {
    background-color: #1d2d44;
    position: absolute;
    transition: all 0.2s ease;
    z-index: 1;
}

.copyBox:hover {
    background-color: #4893C6;
}

.fragmentStar {
    position: absolute;
    color: #1d2d44;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    pointer-events: none;
    user-select: none;
    z-index: 1;
    transition: all 0.2s ease;
}

.fragmentStar-highlight {
    color: #4893C6;
    font-size: 26px;
    z-index: 10;
}

#gridWrapper {
    position: absolute;
    transition: transform 0.3s ease;
}

.gridCell {
    width: 300px;
    height: 300px;
    position: absolute;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    border: 1px solid #1d2d44;
    background: #AECBEB;
    overflow: hidden;
}

.asciiArt {
    font-family: monospace;
    font-size: 5px;
    line-height: 5px;
    color: #1d2d44;
    margin: 0;
    white-space: pre;
    pointer-events: none;
    user-select: none;
}

#handsContainer {
    border: 3px inset #1d2d44;
    padding: 4px;
    background: #AECBEB;
    height: 150px
}

#hands {
    padding: 8px;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(3, min-content);
    gap: 4px;
    overflow: auto;
}

#handsTitle {
    font-weight: bold;
    color: #1d2d44;
    user-select: none;
}

.handItem {
    border: 2px solid #4893C6;
    height: min-content;
    width: 88px;
    padding: 2px;
    text-align: center;
    cursor: pointer;
    font-size: 10px;
    background: #AECBEB;
    transition: all 0.2s;
    user-select: none;
}

.handItem:hover {
    background: #4893C6;
    color: #AECBEB;
}

.tagDisplayContainer {
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #1d2d44;
    height: auto;
    background: #AECBEB;
    min-height: 60px;
}

.tagLabel {
    font-weight: bold;
    margin-bottom: 5px;
    color: #4893C6;
}

.tagsContainer {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.tag-span {
    font-size: 10px;
    padding: 3px 8px;
    background: #4893C6;
    color: #AECBEB;
    border: 1px solid #1d2d44;
}

.tag-none {
    font-style: italic;
    color: #4893C6;
}

.selectorContainer {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #1d2d44;
    margin-bottom: 10px;
    background: #AECBEB;
}

.selectorLabel {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 12px;
}

.selectorLabel:hover {
    background: #4893C6;
    color: #AECBEB;
}

input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border: 1px solid #1d2d44;
    background: #AECBEB;
    cursor: pointer;
    position: relative;
}

input[type="checkbox"]:checked {
    background: #4893C6;
    border: 1px solid #1d2d44;
}

input[type="checkbox"]:hover {
    border-color: #4893C6;
}

#navControls {
    display: grid;
    grid-template-columns: repeat(3, 40px);
    grid-template-rows: repeat(3, 20px);
    gap: 5px;
    width: fit-content;
}

.navButton {
    background: #1d2d44;
    color: #AECBEB;
    border: 2px solid #1d2d44;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1em;
    user-select: none;
    transition: all 0.2s;
    max-height: min-content;
    font-family: "Xanh Mono", sans-serif;
}

#navControls>div:hover {
    background: #4893C6;
    color: #AECBEB;
    border: 2px solid #4893C6;
}

#navControls>div:active {
    background: #AECBEB;
    color: #1d2d44;
}

#up {
    grid-column: 2;
    grid-row: 1;
}

#down {
    grid-column: 2;
    grid-row: 3;
}

#left {
    grid-column: 1;
    grid-row: 2;
}

#right {
    grid-column: 3;
    grid-row: 2;
}

.completion-message {
    padding: 10px;
    line-height: 1.4em;
    font-size: 0.9em;
    font-weight: normal;
}

.completion-message p {
    margin: 0 0 10px 0;
}

.goal-text {
    font-weight: bold;
    border: 2px solid #4893C6;
    padding: 8px;
    margin-top: 10px;
    background: rgba(72, 147, 198, 0.2);
}

.success-message {
    padding: 8px;
    font-weight: bold;
    color: #4893C6;
}

.error-message {
    padding: 8px;
    font-weight: bold;
    color: #1d2d44;
    border: 1px solid #1d2d44;
}

.warning-message {
    padding: 8px;
    font-size: 0.9em;
    color: #1d2d44;
    border: 1px dashed #4893C6;
    margin-top: 8px;
}

.extracted-list-item {
    padding: 8px;
    border: 1px solid #1d2d44;
    margin-bottom: 4px;
    cursor: pointer;
    font-size: 0.9em;
    white-space: pre-wrap;
    transition: all 0.2s;
}

.extracted-list-item:hover {
    background: #4893C6;
    color: #AECBEB;
}

.extracted-preview {
    padding: 10px;
    border: 1px solid #1d2d44;
    margin-bottom: 10px;
    min-height: 40px;
}

.extracted-preview-empty {
    font-style: italic;
    color: #4893C6;
}

.extracted-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.source-info {
    font-size: 0.9em;
    color: #4893C6;
    margin-bottom: 10px;
}

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

.archaeology-count {
    margin-bottom: 8px;
    color: #4893C6;
    user-select: none;

}

.button-spacing {
    margin-top: 10px;
}

.empty-message {
    padding: 20px;
    text-align: center;
    color: #4893C6;
    font-style: italic;
}

.tags-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 280px;
    overflow-y: auto;
}

.tag-count-item {
    padding: 8px 12px;
    border: 1px solid #1d2d44;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.95em;
    user-select: none;
}

.tag-count-item:hover {
    background: #4893C6;
    color: #AECBEB;
}

.extracted-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    border-bottom: 1px solid #1d2d44;
    gap: 8px;
}

.extracted-item-row:last-child {
    border-bottom: none;
}

.extracted-item-info {
    font-size: 0.85em;
    flex: 1;
}

.button-small {
    padding: 2px 8px;
    font-size: 10px;
}

.button-disabled {
    opacity: 0.5;
    cursor: default;
    border-color: #1d2d44;
}

.button-disabled:hover {
    background: #AECBEB;
    color: #1d2d44;
}

.actionButton {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px inset #1d2d44;
    margin: 10px auto;
    background: #1d2d44;
    color: #AECBEB;
    width: 8rem;
    height: 3rem;
    padding: 0.5rem;
    font-family: "Xanh Mono", sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-transform: lowercase;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    user-select: none;
}

.actionButton:hover {
    background: #4893C6;
    border-color: #4893C6;
}

.outputBtnRow {
    display: flex;
    flex-direction: row;
    gap: 6px;
    justify-content: center;
    margin-bottom: 10px;
}

.outputBtnRow .actionButton {
    margin: 0;
    flex: 1;
}


.hr-header {
    font-weight: bold;
    font-size: 11px;
    border-bottom: 1px solid #1d2d44;
    padding-bottom: 6px;
    margin-bottom: 4px;
    letter-spacing: 0.05em;
    font-family: "Xanh Mono", sans-serif;
}

.hr-subheader {
    font-size: 9px;
    color: #4893C6;
    margin-bottom: 12px;
    font-family: "Xanh Mono", sans-serif;
}

.hrField {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hrField label {
    font-size: 10px;
    color: #1d2d44;
    font-family: "Xanh Mono", sans-serif;
}

.hrHint {
    font-size: 9px;
    color: #4893C6;
    font-style: italic;
    font-family: "Xanh Mono", sans-serif;
}

.hrField input[type="text"],
.hrField select {
    width: 100%;
    box-sizing: border-box;
    font-family: "Xanh Mono", sans-serif;
    font-size: 11px;
    color: #1d2d44;
    background: #AECBEB;
    border: 1px solid #1d2d44;
    padding: 4px 6px;
}

.hrField input[type="text"]:focus,
.hrField select:focus {
    outline: none;
    border-color: #4893C6;
    background: #c8ddf0;
}

#hrProgressBar {
    width: 100%;
    height: 14px;
    border: 1px solid #1d2d44;
    margin-top: 8px;
    background: #AECBEB;
}

#hrProgressFill {
    height: 100%;
    width: 0%;
    background: #1d2d44;
    transition: none;
}

.hrMemo {
    border: 1px solid #1d2d44;
    padding: 10px;
    margin-top: 10px;
    font-size: 10px;
    line-height: 1.8;
    background: #AECBEB;
    font-family: "Xanh Mono", sans-serif;
}

.hrMemo .hrMemoHeader {
    font-weight: bold;
    font-size: 12px;
    margin-bottom: 6px;
    letter-spacing: 0.1em;
}

#hrStatus {
    font-size: 10px;
    margin-top: 8px;
    font-family: "Xanh Mono", sans-serif;
}

#hrSubmitBtn {
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
}

.hrBlocking {
    font-size: 10px;
    color: #1d2d44;
    border: 1px dashed #1d2d44;
    padding: 10px;
    line-height: 1.6;
    font-family: "Xanh Mono", sans-serif;
}

.hrValidationLine {
    font-size: 9px;
    color: #4893C6;
    line-height: 1.8;
    display: block;
    font-family: "Xanh Mono", sans-serif;
}

.hrError {
    font-size: 9px;
    color: #1d2d44;
    font-weight: bold;
    font-family: "Xanh Mono", sans-serif;
}

.hrSuccess {
    font-size: 9px;
    color: #4893C6;
    font-family: "Xanh Mono", sans-serif;
}

#belowHandsRow {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
    margin-top: 4px;
}

#restartOnboarding {
    width: 20px;
    height: 20px;
    border: 2px solid #4893C6;
    background: #AECBEB;
    color: #4893C6;
    font-family: "Xanh Mono", sans-serif;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    user-select: none;
}

#restartOnboarding:hover {
    background: #4893C6;
    color: #AECBEB;
}

#archiveBtn {
    width: auto;
    height: 20px;
    padding: 0 6px;
    border: 2px solid #4893C6;
    background: #AECBEB;
    color: #4893C6;
    font-family: "Xanh Mono", sans-serif;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    user-select: none;
}

#archiveBtn:hover {
    background: #4893C6;
    color: #AECBEB;
}

/* --- Onboarding Overlay --- */

#onboardingBlocker {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9997;
}

#onboardingOverlay {
    position: fixed;
    z-index: 9998;
    box-shadow: 0 0 0 9999px rgba(29, 45, 68, 0.82);
    transition: top 0.3s ease, left 0.3s ease, width 0.3s ease, height 0.3s ease;
    pointer-events: none;
}

.onboarding-spotlight-target {
    position: relative !important;
    z-index: 9999 !important;
}

#onboardingCard {
    position: fixed;
    z-index: 10000;
    border: 3px inset #1d2d44;
    background: #AECBEB;
    padding: 16px;
    padding-top: 28px;
    max-width: 320px;
    font-family: "Xanh Mono", sans-serif;
    color: #1d2d44;
    text-transform: lowercase;
}

.onboarding-text {
    font-size: 1em;
    line-height: 1.5em;
    margin-bottom: 12px;
    font-weight: normal;
}

.onboarding-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.onboarding-btn {
    padding: 3px 10px;
    border: 2px solid #4893C6;
    cursor: pointer;
    user-select: none;
    font-family: "Xanh Mono", sans-serif;
    font-size: 12px;
    background: #AECBEB;
    color: #1d2d44;
    transition: all 0.2s;
    text-transform: lowercase;
}

.onboarding-btn:hover {
    background: #4893C6;
    color: #AECBEB;
}

.onboarding-btn-skip {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #1d2d44;
    cursor: pointer;
    user-select: none;
    font-family: "Xanh Mono", sans-serif;
    font-size: 11px;
    background: transparent;
    color: #1d2d44;
    transition: all 0.2s;
    text-transform: lowercase;
}

.onboarding-btn-skip:hover {
    background: #1d2d44;
    color: #AECBEB;
}

.onboarding-btn-back {
    min-width: 28px;
    text-align: center;
}

.onboarding-step-indicator {
    font-size: 11px;
    color: #4893C6;
    user-select: none;
    white-space: nowrap;
}

.analysis-report {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.report-section {
    border-top: 1px solid #4893C6;
    padding-top: 6px;
    font-size: 11px;
    font-weight: normal;
    line-height: 1.6em;
    color: #1d2d44;
}