* { box-sizing: border-box; }
body {
  font-family: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", sans-serif;
  margin: 0;
  background: #f0f6ff;
  color: #223;
}
header {
  background: #3b82f6;
  color: #fff;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}
header h1 { font-size: 18px; margin: 0; flex: 1; }
.ticket-badge {
  background: #fff;
  color: #b45309;
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: bold;
  font-size: 16px;
}
button {
  font-family: inherit;
  font-size: 15px;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  background: #3b82f6;
  color: #fff;
}
button:hover { filter: brightness(1.1); }
button:disabled { background: #9ca3af; cursor: not-allowed; }
button.secondary { background: #e5e7eb; color: #374151; }
button.big { font-size: 18px; padding: 14px 24px; }
input, textarea, select {
  font-family: inherit;
  font-size: 15px;
  border: 2px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px;
}
textarea { width: 100%; resize: vertical; }

/* login */
.login-box {
  max-width: 420px;
  margin: 80px auto;
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
.login-box h1 { color: #3b82f6; }
.login-box input { font-size: 24px; text-align: center; width: 100%; margin: 12px 0; }
.error { color: #dc2626; min-height: 1.4em; font-weight: bold; }

/* student layout */
.layout { display: flex; gap: 12px; padding: 12px; align-items: flex-start; }
.sidebar { width: 220px; flex-shrink: 0; }
.main { flex: 1; min-width: 0; }
.card {
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.card h2 { font-size: 15px; margin: 0 0 10px; color: #3b82f6; }
.work-item {
  display: block;
  width: 100%;
  text-align: left;
  background: #eff6ff;
  color: #223;
  margin-bottom: 6px;
  border: 2px solid transparent;
}
.work-item.selected { border-color: #3b82f6; background: #dbeafe; }
.odai-box { background: #fef9c3; border-radius: 10px; padding: 10px; white-space: pre-wrap; }

#preview {
  width: 100%;
  height: 540px;
  border: 3px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
}
/* 作品棚・公開ギャラリーのプレイ画面。画面の高さに応じて縮み、下が見切れないようにする */
.gallery-frame {
  width: 100%;
  height: min(560px, 68vh);
  border: 3px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
}
#genlog {
  background: #0f172a;
  color: #86efac;
  font-family: monospace;
  font-size: 11px;
  border-radius: 10px;
  padding: 10px;
  height: 90px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  display: none;
}
/* fullscreen preview */
.fullscreen-wrap { position: relative; }
.fullscreen-wrap.fs {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
}
.fullscreen-wrap.fs iframe {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
  border-radius: 0 !important;
}
.fs-exit {
  display: none;
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1001;
  background: #fff;
  color: #223;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.fullscreen-wrap.fs .fs-exit { display: block; }

.version-item { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; font-size: 13px; }
.version-item .when { color: #64748b; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.gallery-card { background: #fff; border-radius: 12px; padding: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.gallery-card h3 { margin: 0 0 4px; font-size: 15px; }
.gallery-card .by { color: #64748b; font-size: 12px; }
.tabs { display: flex; gap: 8px; padding: 12px 12px 0; }
.tabs button { background: #dbeafe; color: #1e3a8a; }
.tabs button.active { background: #3b82f6; color: #fff; }
.hidden { display: none !important; }

/* teacher */
table { border-collapse: collapse; width: 100%; background: #fff; }
th, td { border: 1px solid #e2e8f0; padding: 8px 10px; text-align: left; font-size: 14px; }
th { background: #eff6ff; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stat { font-size: 22px; font-weight: bold; color: #3b82f6; }
.muted { color: #64748b; font-size: 13px; }
