:root {
  --bg: #f7f5ff;
  --text: #3b3b45;
  --accent: #89c2ff;
  --accent2: #ff9ecb;
  --button-bg: #7cc5b9;
  --button-text: #11332f;
  --logo-image: url('/logo.png');
}

* { box-sizing: border-box }
html, body { height: 100% }
body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.panel {
  width: 100%;
  max-width: 1200px;
  background: #ffffff;
  border-radius: 36px;
  box-shadow: 0 20px 60px rgba(55, 70, 100, 0.12);
  padding: 48px;
  position: relative;
}

.header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
  position: relative;
  z-index: 2;
}

.top-logo { display: flex; justify-content: center; margin-bottom: 12px }

.home-header { justify-content: center }
.home-header > div { text-align: center }

.logo {
  width: 144px;
  height: 144px;
  border-radius: 50%;
  background-color: transparent;
  background-image: var(--logo-image);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border: 0;
  outline: 0;
  box-shadow: none;
  overflow: hidden;
  clip-path: circle(50% at 50% 50%);
}

.title {
  font-size: 52px;
  line-height: 1.1;
  font-weight: 800;
}

.home-title { font-size: 36px }
.home-title { text-align: center }

.subtitle { font-size: 22px }
.home-header .subtitle { margin-top: 36px }
.title, .subtitle, .label, .list-item, .student-name, .student-class, .student-ready, .field, .btn { opacity: 1 }

.title.dynamic {
  background: linear-gradient(90deg, #ff9ecb, #ffd77e, #89c2ff, #a8f7a1);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: titleGradient 8s ease infinite;
}

@keyframes titleGradient {
  0% { background-position: 0% 50% }
  50% { background-position: 100% 50% }
  100% { background-position: 0% 50% }
}

.input-row { display: flex; gap: 16px; margin-top: 24px }

.input-number {
  flex: 1;
  font-size: clamp(22px, 5vw, 40px);
  padding: 18px 24px;
  border-radius: 24px;
  border: 2px solid #dfe7f5;
  outline: none;
  width: 100%;
}

.btn {
  font-size: clamp(20px, 4.2vw, 32px);
  padding: 18px 28px;
  border-radius: 24px;
  border: none;
  background: var(--button-bg);
  color: var(--button-text);
  cursor: pointer;
  transition: transform .05s ease;
}
.btn:active { transform: scale(.98) }

.btn.primary {
  background: linear-gradient(135deg, #7cc5b9 0%, #59b2a3 50%, #48a093 100%);
  color: #ffffff;
  border-radius: 999px;
  padding: 18px 36px;
  box-shadow: 0 10px 20px rgba(72, 160, 147, 0.25), 0 2px 6px rgba(0,0,0,.08);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn.primary:hover { transform: translateY(-1px); filter: brightness(1.03) }
.btn.primary:active { transform: translateY(0); box-shadow: 0 6px 14px rgba(72,160,147,.22) }

.btn.soft {
  background: #f8fbff;
  color: #334155;
  border: 1px solid #e7eef9;
  border-radius: 16px;
  box-shadow: none;
}
.btn.soft:hover { background: #eef5ff }

.clouds {
  position: absolute;
  inset: -40px -40px auto -40px;
  height: 140px;
  background: radial-gradient(ellipse at 20% 60%, #fff 0 35%, transparent 40%),
              radial-gradient(ellipse at 45% 50%, #fff 0 35%, transparent 40%),
              radial-gradient(ellipse at 65% 55%, #fff 0 35%, transparent 40%),
              radial-gradient(ellipse at 85% 60%, #fff 0 35%, transparent 40%);
  opacity: .75;
  z-index: 0;
  pointer-events: none;
}

.rainbow {
  position: absolute;
  right: 40px;
  top: -30px;
  width: 220px;
  height: 120px;
  border-radius: 120px 120px 0 0;
  background: conic-gradient(#ff9ecb 0 20%, #ffd77e 20% 40%, #a8f7a1 40% 60%, #89c2ff 60% 80%, #caa3ff 80% 100%);
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  z-index: 0;
  pointer-events: none;
  display: none;
}

.wood {
  position: absolute;
  bottom: -24px;
  left: 24px;
  right: 24px;
  height: 24px;
  border-radius: 16px;
  background: repeating-linear-gradient(90deg, #c8a77a 0 30px, #b99162 30px 60px);
  box-shadow: inset 0 6px 10px rgba(0,0,0,.15);
  z-index: 0;
  pointer-events: none;
}

.grid { display: grid; gap: 16px }
.grid.cols-2 { grid-template-columns: 1fr 1fr }

.admin-layout { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; margin-top: 16px }
.sidebar { display: grid; gap: 10px; align-content: start }
.sidebar .btn { width: 100% }
.content { min-height: 300px }
.page { }

.card {
  padding: 24px;
  border-radius: 24px;
  background: #fff;
  border: 2px solid #e7eef9;
}

.label { font-size: 20px }
.field { font-size: 24px; padding: 14px 18px; border-radius: 18px; border: 2px solid #dfe7f5 }

.list { margin-top: 18px }
.list-item { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-radius: 16px; background: #f8fbff }

.inline-notice { margin-top: 16px }

.notice {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(22,32,45,.2);
  z-index: 10000;
}
.notice.visible { display: flex }
.notice-box { background: #fff; border-radius: 40px; padding: 40px; max-width: 1600px; width: 92vw; max-height: 88vh; overflow-y: auto; box-shadow: 0 18px 50px rgba(0,0,0,.2) }
.notice-list { display: flex; flex-direction: column; gap: 20px }
.notice-item { padding: 24px; border-radius: 24px; background: #ffffff; border: 2px solid #e7eef9 }
.notice-item.flash { animation: noticeFlash 1s ease-in-out infinite; border-color: var(--accent); box-shadow: 0 0 0 0 rgba(0,0,0,0) }
@keyframes noticeFlash {
  0% { border-color: var(--accent); box-shadow: 0 0 0 0 rgba(0,0,0,0) }
  50% { border-color: var(--accent2); box-shadow: 0 0 22px rgba(0,0,0,.18) }
  100% { border-color: var(--accent); box-shadow: 0 0 0 0 rgba(0,0,0,0) }
}
.student-row { display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: center }
.student-photo { width: 200px; height: 200px; border-radius: 28px; background: #f1f5fb; display: grid; place-items: center; font-size: 60px; background-repeat: no-repeat }
.student-name { font-size: 36px; font-weight: 900 }
.student-class { font-size: 18px; margin-top: 8px }
.student-ready { font-size: 26px; margin-top: 16px; color: #1a6d5e }

@media (max-width: 900px) {
  .title { font-size: 38px }
  .home-title { font-size: 27px }
  .btn { font-size: clamp(18px, 4.8vw, 24px) }
  .home-header .subtitle { margin-top: 28px }
  .student-row { grid-template-columns: 1fr }
  .student-name { font-size: 28px }
  .student-ready { font-size: 20px }
}

@media (max-width: 700px) {
  .header { flex-direction: column; align-items: flex-start; gap: 16px }
  .logo { width: 120px; height: 120px }
  .input-row { flex-direction: column; align-items: stretch; gap: 12px }
  .btn { width: 100% }
  .panel { padding: 28px }
  .footer { overflow: hidden }
  .footer-grid { grid-template-columns: 1fr; gap: 12px }
}

@media (max-width: 480px) {
  .footer { padding: 0; border-radius: 0 }
  .footer-bottom { font-size: 12px }
}

.footer { margin-top: 16px; width: 100%; max-width: 1200px; background: transparent; color: inherit; border-radius: 0; padding: 0 }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; align-items: start }
.footer-title { font-size: 18px; font-weight: 800; color: #e5edf9; margin-bottom: 12px }
.footer-text { font-size: 14px; color: #cbd5e1; line-height: 1.6; word-break: break-word; overflow-wrap: anywhere }
.footer-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px }
.footer-list li { display: flex; align-items: center; gap: 8px; color: #cbd5e1; word-break: break-word; overflow-wrap: anywhere }
.footer-list li::before { content: '›'; color: #94a3b8 }
.footer a { color: #64748b; text-decoration: none }
.footer a:hover { color: #334155 }
.footer-bottom { margin-top: 0; text-align: center; font-size: 13px; color: #64748b }
.footer-links { display: flex; justify-content: center; gap: 12px; margin-top: 4px; font-size: 13px }
@media (max-width: 480px) { .footer-links { flex-wrap: wrap; gap: 8px } }

.back-btn { position: absolute; top: 16px; left: 16px; font-size: 14px; padding: 8px 12px; border-radius: 14px; background: #f1f5fb; color: #334155; border: 1px solid #e7eef9; text-decoration: none }

.menu-toggle { display: none }
@media (max-width: 900px) {
  .menu-toggle { display: inline-flex; align-items: center; position: fixed; top: 14px; right: 14px; z-index: 10002; font-size: 16px; padding: 10px 14px; border-radius: 16px }
  .admin-layout { grid-template-columns: 1fr; gap: 12px }
  .label { font-size: 18px }
  .field { font-size: 18px; padding: 12px 14px }
  .list-item { flex-direction: column; align-items: flex-start; gap: 8px }
  .sidebar .btn { font-size: 16px; padding: 12px 14px }
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 80vw; max-width: 340px; background: #ffffff; border-right: 2px solid #e7eef9; padding: 20px; transform: translateX(-100%); transition: transform .2s ease; z-index: 10001 }
  .sidebar.open { transform: translateX(0) }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.22); display: none; z-index: 10000 }
  .sidebar-backdrop.visible { display: block }
}

body.theme-5yas-a { --bg: #f7faff; --accent: #8fd3f4; --accent2: #caa3ff; --button-bg: #7cc5b9 }
body.theme-5yas-b { --bg: #fff7fa; --accent: #ffd77e; --accent2: #ff9ecb; --button-bg: #ffcf99 }
body.theme-5yas-c { --bg: #f9fff7; --accent: #a8f7a1; --accent2: #89c2ff; --button-bg: #9fd4a4 }
body.theme-5yas-d { --bg: #fffaf7; --accent: #caa3ff; --accent2: #ffd77e; --button-bg: #f5b9a6 }
body.theme-4yas-a { --bg: #f7fbff; --accent: #89c2ff; --accent2: #a8f7a1; --button-bg: #9fc9ff }
