body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: #222;
    color: #fff;
    font-family: sans-serif;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    z-index: 10;
}

#viewer {
    flex: 1; /* 画面の残りの高さをすべて使う */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 20px;
    box-sizing: border-box;
}

canvas {
    background-color: white;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
    display: none; /* 読み込み完了まで隠す */
}

#controls {
    height: 60px;
    background-color: #111;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

button {
    padding: 10px 20px;
    font-size: 1rem;
    cursor: pointer;
    background-color: #444;
    color: white;
    border: none;
    border-radius: 5px;
}

button:hover {
    background-color: #666;
}

button:disabled {
    background-color: #222;
    color: #555;
    cursor: not-allowed;
}

.page-info {
    font-size: 1.1rem;
    min-width: 80px;
    text-align: center;
}