* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

canvas {
    width: 100%;
    height: 100%;
    position: absolute;
}

@font-face {
    font-family: "Kristiania";
    src: url("/files/fonts/Kristiania-Transform2.5.otf") format('opentype');
    font-weight: normal;
    font-style: normal;
}

/* Errors from the student's program, shown on top of the game */
#engine-errors {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    max-height: 40vh;
    overflow-y: auto;
    background: rgba(40, 0, 0, 0.92);
    color: #ffe9e9;
    font: 14px/1.4 Consolas, Menlo, monospace;
    border-top: 3px solid #ff5b5b;
}

#engine-errors[hidden] {
    display: none;
}

#engine-errors header {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 12px;
    background: #7a1010;
    font-family: system-ui, sans-serif;
}

#engine-errors header button {
    border: none;
    background: none;
    color: inherit;
    font-size: 20px;
    cursor: pointer;
}

#engine-errors ol {
    list-style: none;
    padding: 6px 12px;
}

#engine-errors li {
    padding: 4px 0;
    white-space: pre-wrap;
}

#engine-errors li + li {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

#engine-errors .note {
    font-family: system-ui, sans-serif;
    font-weight: bold;
}

#engine-errors .where,
#engine-errors .count {
    color: #ffb4b4;
}

/* Toast notifications (echo) */
.echo-container {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    display: flex;
    gap: 8px;
    box-sizing: border-box;
}

.echo-toast {
    pointer-events: auto;
    cursor: pointer;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    user-select: none;
    word-break: break-word;
    box-sizing: border-box;
}

.echo-toast-title {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.3;
    margin-bottom: 4px;
}

.echo-toast-message {
    font-size: 13px;
    line-height: 1.4;
}