html, body {
    margin: 0;
    overscroll-behavior: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--mud-palette-background);
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* --- 入力の一時停止（Components/InputLock.cs） --- */
.input-lock {
    pointer-events: none;
    opacity: 0.6;
}

.table-controls > *,
.action-panel {
    transition: opacity 0.2s;
}

/* --- エラー表示 --- */
.error-panel {
    padding: 32px 16px;
    max-width: 480px;
    margin: 0 auto;
}

/* --- 起動中の表示 --- */
#app-loading {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: #1b6e3c;
    color: #fff;
    font-family: system-ui, sans-serif;
    z-index: 9999;
    transition: opacity 0.35s;
}

#app-loading.done {
    opacity: 0;
    pointer-events: none;
}

/* チップを親指ではじいたように、跳ねながら縦に一回転させ、着地したら少し休む */
.app-loading-chip {
    width: 96px;
    height: 96px;
    animation: app-chip-flip 1.8s ease-in-out infinite;
}

.app-loading-chip svg {
    display: block;
    width: 100%;
    height: 100%;
}

@keyframes app-chip-flip {
    0%, 15% { transform: translateY(0) rotateX(0); }
    45% { transform: translateY(-40px) rotateX(180deg); }
    75%, 100% { transform: translateY(0) rotateX(360deg); }
}

/* 足もとの影。チップが高いほど小さく薄くする */
.app-loading-shadow {
    width: 72px;
    height: 10px;
    margin-top: -12px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.25);
    animation: app-chip-shadow 1.8s ease-in-out infinite;
}

@keyframes app-chip-shadow {
    0%, 15% { transform: scale(1); opacity: 1; }
    45% { transform: scale(0.55); opacity: 0.5; }
    75%, 100% { transform: scale(1); opacity: 1; }
}

.app-loading-text {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    animation: app-text-pulse 1.5s ease-in-out infinite;
}

@keyframes app-text-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* 起動に失敗したら動きを止め、復旧ボタンだけを見せる */
#app-loading.failed .app-loading-chip,
#app-loading.failed .app-loading-shadow {
    animation: none;
}

#app-loading.failed .app-loading-text {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .app-loading-chip,
    .app-loading-shadow,
    .app-loading-text {
        animation: none;
    }
}

#app-loading-error {
    text-align: center;
}

#app-loading-error button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 0.6rem 1.25rem 0.7rem;
    background: lightyellow;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
    cursor: pointer;
}
