@charset "utf-8";
* {
    margin: 0;
    padding: 0;
}
html {
    font-size: 16px;
}
body {
    font-family: 'メイリオ', Osaka;
    padding: 1em;
    font-size: 16px;
}

h1 {
    border-bottom: solid 1px #555;
    font-size: 36px;
}
p#time {
    font-size: 48pt;
    padding-top: 0.5em;
}
button {
    display: inline-block;
    width: 5em;
    padding: 5pt;
    font-size: 18pt;
    border: solid 1px #555;
    border-radius: 12pt;
    margin-right: 10px;
    margin-bottom: 10px;
}
button:hover {
    background-color: pink;
}
.button {
    display: inline-block;
    border-radius: 5%;
    font-size: 18pt;
    text-align: center;
    cursor: pointer;
    padding: 12px 12px;
    background: #000066;
    color: #ffffff;
    line-height: 1em;
    transition: .3s;
    box-shadow: 6px 6px 3px #666666;
    border: 2px solid #000066;
}
.button:hover {
    box-shadow: none;
    color: #000066;
    background: #ffffff;
}
footer {
    color: #ddd;
    text-align: right;
}
input, select {
    font-size: 100%;
}
table {
    border-collapse: collapse;
    width: 100%;
}
th, td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}
th {
    background-color: #f2f2f2;
    color: #333;
}
input[type=checkbox] {
    transform: scale(1.5);
    margin: 0 6px 0 0;
}

/* ========== 修正対象 ========== */
.classroom-background {
    background-image: url('https://sigma-zemi.com/studyrecord/classroom_bg.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    background-attachment: fixed;
    padding: 30px 10px;
    min-height: 500px;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow-y: auto;
    max-height: 600px;
}

.classroom-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); /* ← auto-fill に変更し安定化 */
    gap: 20px;
    justify-content: start;
    align-content: start;  /* ← グリッド行の詰め位置を上寄せ */
    padding: 0;
}

.student-avatar {
    text-align: center;
    width: 100px;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 12px;
    box-shadow: 2px 2px 6px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.student-avatar img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #ccc;
}

.student-avatar .name {
    margin-top: 6px;
    font-weight: bold;
    font-size: 14px;
}

.avatar-wrapper {
    position: relative;
    display: inline-block;
}

.avatar-wrapper img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ccc;
}

.level-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: bold;
    z-index: 10;
}

/* ========================== */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: #fff;
    border-top: 1px solid #ccc;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
}
.bottom-nav a {
    flex: 1;
    text-align: center;
    text-decoration: none;
    color: #333;
    font-size: 12px;
    padding: 5px;
    transition: background 0.2s;
}
.bottom-nav a:hover {
    background: #f0f0f0;
}
.bottom-nav i {
    font-size: 18px;
    display: block;
    margin-bottom: 3px;
}
.bottom-nav span {
    display: block;
}
.bottom-nav a .badge {
  position: absolute;
  top: 5px;
  right: 25%;
  background: red;
  color: white;
  font-weight: bold;
  font-size: 0.75em;
  padding: 2px 6px;
  border-radius: 50%;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}
.cheer-message {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #ffde7d, #ffd700);
    color: #333;
    font-size: 1.2em;
    font-weight: bold;
    text-align: center;
    border: 2px dashed #f39c12;
    border-radius: 12px;
    animation: fadeIn 0.6s ease-in-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.progress-container {
    margin-top: 20px;
    padding: 10px;
}
.progress-wrapper {
    margin-bottom: 12px;
}
.progress-label {
    font-weight: bold;
    margin-bottom: 4px;
}
.progress-bar {
    height: 16px;
    background: linear-gradient(to right, #4caf50, #81c784);
    border-radius: 8px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
    transition: width 0.5s ease;
}

/* レスポンシブ調整 */
@media screen and (max-width: 480px) {
    body {
        font-size: 4.266vw !important;
    }
    h1 {
        font-size: 26px;
    }
    p#top {
        font-size: 13pt;
        padding-top: 0.5em;
        display: flex;
        align-items: center;
    }
    input, select {
        font-size: 150%;
    }
    button {
        width: 9em;
        font-size: 10pt;
        margin-right: 10px;
        margin-bottom: 10px;
        box-sizing: border-box;
        line-height: 1.2;
    }
    .student-avatar {
        width: 80px;
    }
    .bottom-nav span {
        font-size: 10px;
    }
    .bottom-nav i {
        font-size: 16px;
    }
}
