/* __V3D_TEMPLATE__ - template-based file; delete this line to prevent this file from being updated */

html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

noscript {
    display: block;
    text-align: center;
    padding-top: 100px;
    font-size: 20px;
}

.v3d-container {
    position: absolute;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
}

.fullscreen-button {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    background-size: 100% 100%;
    display: none;
    z-index: 950;
}

.fullscreen-open {
    background-image: url('media/fullscreen_open.svg');
}

.fullscreen-close {
    background-image: url('media/fullscreen_close.svg');
}

/* removes tap blinking on ios devices */
* { -webkit-tap-highlight-color:rgba(0,0,0,0); }

/* --- Tangram courseware overlay (above WebGL canvas) --- */
#v3d-container {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.tg-overlay {
    position: absolute;
    inset: 0;
    z-index: 900;
    pointer-events: none;
    box-sizing: border-box;
}

.tg-overlay[hidden] {
    display: none !important;
}

.tg-overlay--visible {
    pointer-events: none;
}

.tg-courseware {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    pointer-events: none;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.tg-courseware-inner {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr min(240px, 30vw);
    grid-template-rows: 1fr;
    gap: 8px;
    padding: 8px;
    pointer-events: none;
}

.tg-zone {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: rgba(255, 251, 245, 0.94);
    border: 1px dashed rgba(25, 118, 210, 0.45);
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.tg-zone--work {
    background: rgba(255, 255, 255, 0.88);
}

.tg-zone--tray {
    /* naturally placed in column 2 */
}

.tg-zone__title {
    margin: 0;
    padding: 6px 10px 4px;
    font-size: 14px;
    font-weight: 600;
    color: #1565c0;
}

.tg-zone__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 4px 8px 0;
}

.tg-zone__head .tg-zone__title {
    padding: 0;
}

.tg-zone__body {
    flex: 1;
    min-height: 0;
    position: relative;
    padding: 6px;
}

.tg-zone__body--work {
    background: linear-gradient(180deg, rgba(227, 242, 253, 0.35), rgba(255, 255, 255, 0.2));
}

.tg-rotate-ray {
    pointer-events: none;
    opacity: 0.94;
}

.tg-rotate-pivot {
    pointer-events: none;
}

.tg-rotate-handle {
    cursor: ns-resize;
    pointer-events: auto;
}

.tg-rotate-handle:active {
    cursor: ns-resize;
}

.tg-flip-handle {
    cursor: pointer;
    pointer-events: auto;
}

.tg-flip-handle:active {
    cursor: pointer;
}

.tg-btn-bar {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 8px 10px;
    pointer-events: auto;
}

.tg-btn {
    font-size: 15px;
    font-weight: 600;
    padding: 10px 28px;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}

.tg-btn--fit {
    background: #e3f2fd;
    color: #1565c0;
    border-color: rgba(21, 101, 192, 0.3);
}

.tg-btn--fit:hover {
    background: #bbdefb;
    border-color: #1565c0;
}

.tg-btn--reset {
    background: #fff3e0;
    color: #e65100;
    border-color: rgba(230, 81, 0, 0.3);
}

.tg-btn--reset:hover {
    background: #ffe0b2;
    border-color: #e65100;
}

.tg-reset-btn {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 4px;
    border: 1px solid rgba(21, 101, 192, 0.45);
    background: rgba(255, 255, 255, 0.9);
    color: #1565c0;
    cursor: pointer;
    margin-left: auto;
    white-space: nowrap;
}

.tg-reset-btn:hover {
    background: #e3f2fd;
}

.tg-zone--complete {
    border-color: #43a047 !important;
    box-shadow: 0 0 12px rgba(67, 160, 71, 0.3) !important;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.tg-zone__body--tray {
    flex: 1;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    position: relative;
    padding: 4px;
    margin-inline: auto;
    box-sizing: border-box;
}

.tg-svg {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

.tg-svg--work {
    min-height: 200px;
}

.tg-ghost {
    fill: none;
    stroke: rgba(21, 101, 192, 0.55);
    stroke-width: 2;
    stroke-dasharray: 7 5;
    pointer-events: none;
}

.tg-piece--selected > polygon:first-of-type {
    stroke: #0d47a1;
    stroke-width: 3;
    filter: drop-shadow(0 0 4px rgba(13, 71, 161, 0.35));
}

.tg-snap-dot {
    pointer-events: none;
}

.tg-horizontal-hint {
    pointer-events: none;
}

@media (max-width: 720px) {
    .tg-courseware-inner {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        padding: 6px;
    }
    .tg-zone--tray {
        order: -1;
        max-height: 180px;
    }
    .tg-zone--tray .tg-zone__body--tray {
        flex: 1;
    }
}


.v3d-simple-preloader-logo {
    background-image: url('media/logo180.png');
}