﻿* {
  box-sizing: border-box;
}


:root {
  --bg: #f7f8fc;
  --surface: #ffffff;
  --text: #293047;
  --muted: #7b8296;
  --primary: #7467e8;
  --primary-dark: #5c50cb;
  --primary-light: #eeecff;
  --blue: #5ca9e6;
  --blue-light: #eaf6ff;
  --yellow: #ffd66b;
  --yellow-light: #fff8df;
  --pink: #ef8fbd;
  --pink-light: #fff0f7;
  --green: #66bd94;
  --green-light: #eaf9f1;
  --border: #e7e9f0;
  --shadow: 0 10px 30px rgba(55, 62, 95, 0.08);
  --radius: 22px;
}


html {
  scroll-behavior: smooth;
}


body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Hiragino Sans",
    "Yu Gothic",
    "Meiryo",
    sans-serif;
}


button,
input,
textarea {
  font: inherit;
}


button {
  cursor: pointer;
}


button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}


.hidden {
  display: none !important;
}




/* =========================
   COMMON
========================= */


.screen {
  min-height: 100vh;
}


.primary-button,
.secondary-button {
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 14px;
  border: none;
  font-weight: 700;
  transition: 0.2s ease;
}


.primary-button {
  background: var(--primary);
  color: white;
}


.primary-button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}


.secondary-button {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}


.secondary-button:hover {
  background: var(--bg);
}


.full-width {
  width: 100%;
}


.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}


.form-group label {
  font-size: 14px;
  font-weight: 700;
}


.form-group input,
.form-group textarea,
.hoppy-input-area textarea,
.message-form input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: white;
  padding: 13px 14px;
  color: var(--text);
  outline: none;
  transition: 0.2s;
}


.form-group input:focus,
.form-group textarea:focus,
.hoppy-input-area textarea:focus,
.message-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}


.small-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}


.eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}


.loading {
  padding: 30px;
  text-align: center;
  color: var(--muted);
}




/* =========================
   AUTH
========================= */


.auth-screen {
  display: grid;
  place-items: center;
  padding: 30px 16px;
  background:
    radial-gradient(circle at 20% 20%, #efedff 0, transparent 28%),
    radial-gradient(circle at 85% 80%, #fff2dc 0, transparent 25%),
    var(--bg);
}


.auth-card {
  width: min(440px, 100%);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 28px;
  padding: 34px;
  box-shadow: var(--shadow);
}


.logo-area {
  text-align: center;
  margin-bottom: 28px;
}


.logo-star {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  border-radius: 24px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 38px;
}


.logo-area h1 {
  margin: 0;
  font-size: 29px;
}


.logo-area p {
  margin: 8px 0 0;
  color: var(--muted);
}


.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--bg);
  border-radius: 14px;
  margin-bottom: 22px;
}


.auth-tab {
  border: none;
  background: transparent;
  padding: 10px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 700;
}


.auth-tab.active {
  background: white;
  color: var(--primary);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}


.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--muted);
  font-size: 12px;
}


.divider::before,
.divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--border);
}


.auth-note {
  margin: 20px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  line-height: 1.7;
}




/* =========================
   HEADER
========================= */


.top-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}


.header-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--primary);
}


.header-logo span {
  font-size: 24px;
}


.header-logo strong {
  color: var(--text);
  font-size: 17px;
}


.header-user {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}


.header-user button {
  border: none;
  background: var(--bg);
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 10px;
}




/* =========================
   MAIN
========================= */


.main-container {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 110px;
}


.page {
  animation: pageIn 0.25s ease;
}


@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }


  to {
    opacity: 1;
    transform: translateY(0);
  }
}




/* =========================
   HOME
========================= */


.hero-card {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 260px;
  padding: 42px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 80% 30%, rgba(255,255,255,.8), transparent 20%),
    linear-gradient(135deg, #ece9ff, #f8f6ff);
}


.hero-card h2 {
  margin: 8px 0 16px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.35;
}


.hero-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}


.hero-star {
  position: relative;
  width: 170px;
  height: 170px;
  display: grid;
  place-items: center;
  color: #897ce9;
  font-size: 110px;
  opacity: 0.9;
  transform: rotate(7deg);
}


.feeling-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 25px;
  margin-top: 20px;
  padding: 24px;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}


.feeling-card h3 {
  margin: 0 0 6px;
}


.feeling-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}


.feeling-buttons {
  display: flex;
  gap: 8px;
}


.feeling-button {
  min-width: 75px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 14px;
  padding: 10px 8px;
  font-size: 22px;
}


.feeling-button span {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  color: var(--muted);
}


.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 20px;
}


.feature-card {
  position: relative;
  min-height: 230px;
  padding: 25px;
  border: 1px solid transparent;
  border-radius: 24px;
  text-align: left;
  transition: 0.2s ease;
  overflow: hidden;
}


.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}


.classroom-card {
  background: var(--blue-light);
}


.senior-card {
  background: var(--yellow-light);
}


.hoppy-card {
  background: var(--pink-light);
}


.feature-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border-radius: 16px;
  background: white;
  font-size: 27px;
}


.feature-label {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: var(--muted);
}


.feature-card h3 {
  margin: 5px 0 10px;
  font-size: 21px;
}


.feature-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 13px;
}


.arrow {
  position: absolute;
  right: 22px;
  bottom: 18px;
  font-size: 23px;
  color: var(--muted);
}


.home-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}


.info-card {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 18px;
  background: white;
  border-radius: 18px;
  border: 1px solid var(--border);
}


.info-card > span {
  font-size: 22px;
}


.info-card strong {
  font-size: 13px;
}


.info-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}




/* =========================
   PAGE HEADING
========================= */


.page-heading {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}


.page-heading h2 {
  margin: 0;
  font-size: 32px;
}


.back-button {
  border: none;
  background: white;
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--muted);
  border: 1px solid var(--border);
}


.page-intro {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 23px;
  background: white;
  border-radius: 22px;
  border: 1px solid var(--border);
  margin-bottom: 22px;
}


.intro-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 16px;
  background: var(--primary-light);
  font-size: 27px;
}


.page-intro h3 {
  margin: 0 0 7px;
}


.page-intro p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
  font-size: 14px;
}




/* =========================
   ROOM
========================= */


.room-section {
  background: white;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 22px;
}


.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}


.section-title-row h3 {
  margin: 0;
}


.small-button {
  border: 1px solid var(--border);
  background: white;
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 12px;
}


.room-list {
  display: grid;
  gap: 10px;
}


.room-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 16px;
  background: var(--bg);
  border-radius: 15px;
}


.room-item h4 {
  margin: 0 0 4px;
}


.room-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}


.room-join {
  border: none;
  background: var(--primary);
  color: white;
  border-radius: 10px;
  padding: 9px 14px;
  font-weight: 700;
}


.room-detail {
  margin-top: 20px;
  background: white;
  border-radius: 22px;
  border: 1px solid var(--border);
  overflow: hidden;
}


.room-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}


.room-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}


.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--green);
}


.room-messages {
  height: 360px;
  overflow-y: auto;
  padding: 20px;
  background: #fafbfe;
}


.room-message {
  max-width: 80%;
  margin-bottom: 12px;
}


.room-message.mine {
  margin-left: auto;
  text-align: right;
}


.room-message-bubble {
  display: inline-block;
  padding: 10px 13px;
  border-radius: 15px;
  background: white;
  border: 1px solid var(--border);
  text-align: left;
}


.room-message.mine .room-message-bubble {
  background: var(--primary-light);
  border-color: transparent;
}


.room-message small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}


.message-form {
  display: flex;
  gap: 8px;
  padding: 15px;
  border-top: 1px solid var(--border);
}


.message-form input {
  flex: 1;
}


.message-form button {
  border: none;
  border-radius: 12px;
  background: var(--primary);
  color: white;
  padding: 0 18px;
}




/* =========================
   SENIOR
========================= */


.senior-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
}


.senior-list-area,
.senior-compose {
  background: white;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 22px;
}


.senior-message-list {
  display: grid;
  gap: 12px;
}


.senior-message {
  padding: 17px;
  background: var(--bg);
  border-radius: 16px;
}


.senior-message .message-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}


.senior-message .sender {
  font-weight: 700;
}


.senior-message time {
  color: var(--muted);
  font-size: 11px;
}


.senior-message p {
  margin: 0;
  line-height: 1.8;
  font-size: 13px;
}


.senior-compose h3 {
  margin-top: 0;
}


.senior-compose > p {
  color: var(--muted);
  line-height: 1.7;
  font-size: 13px;
}




/* =========================
   HOPPY
========================= */


.hoppy-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  margin-bottom: 18px;
  border-radius: 24px;
  background: var(--pink-light);
}


.hoppy-character {
  width: 80px;
  height: 80px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 25px;
  background: white;
  font-size: 45px;
}


.hoppy-card h3 {
  margin: 0 0 8px;
}


.hoppy-card p {
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 13px;
}


.chat-window {
  height: 430px;
  padding: 20px;
  overflow-y: auto;
  background: white;
  border: 1px solid var(--border);
  border-radius: 22px;
}


.chat-message {
  display: flex;
  margin-bottom: 15px;
}


.chat-message.user {
  justify-content: flex-end;
}


.chat-bubble {
  max-width: 78%;
  padding: 12px 15px;
  border-radius: 17px;
  line-height: 1.7;
  font-size: 13px;
  white-space: pre-wrap;
}


.chat-message.hoppy .chat-bubble {
  background: var(--pink-light);
}


.chat-message.user .chat-bubble {
  background: var(--primary-light);
}


.hoppy-input-area {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}


.hoppy-input-area textarea {
  flex: 1;
  resize: none;
}


.hoppy-input-area button {
  min-width: 90px;
}




/* =========================
   BOTTOM NAV
========================= */


.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 15px;
  z-index: 60;
  transform: translateX(-50%);
  width: min(600px, calc(100% - 30px));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px;
  border-radius: 20px;
  background: rgba(255,255,255,.96);
  border: 1px solid var(--border);
  box-shadow: 0 10px 35px rgba(0,0,0,.12);
  backdrop-filter: blur(12px);
}


.nav-button {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 7px;
  border-radius: 13px;
}


.nav-button span {
  display: block;
  font-size: 19px;
}


.nav-button small {
  display: block;
  margin-top: 3px;
  font-size: 9px;
}


.nav-button.active {
  color: var(--primary);
  background: var(--primary-light);
}




/* =========================
   TOAST
========================= */


.toast {
  position: fixed;
  left: 50%;
  top: 85px;
  z-index: 100;
  transform: translate(-50%, -20px);
  max-width: calc(100% - 30px);
  padding: 12px 17px;
  border-radius: 13px;
  background: #292d3d;
  color: white;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s;
  font-size: 13px;
  box-shadow: var(--shadow);
}


.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}




/* =========================
   RESPONSIVE
========================= */


@media (max-width: 850px) {


  .feature-grid {
    grid-template-columns: 1fr;
  }


  .feature-card {
    min-height: 180px;
  }


  .senior-layout {
    grid-template-columns: 1fr;
  }


  .feeling-card {
    flex-direction: column;
    align-items: stretch;
  }


  .feeling-buttons {
    justify-content: space-between;
  }


}


@media (max-width: 600px) {


  .auth-card {
    padding: 25px 20px;
  }


  .top-header {
    padding: 0 14px;
  }


  .header-user {
    gap: 6px;
  }


  .header-user > span {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }


  .main-container {
    width: min(100% - 22px, 1100px);
    padding-top: 20px;
  }


  .hero-card {
    min-height: 270px;
    padding: 28px;
  }


  .hero-star {
    position: absolute;
    right: 4px;
    bottom: -15px;
    opacity: 0.35;
  }


  .hero-card h2 {
    font-size: 29px;
  }


  .home-info {
    grid-template-columns: 1fr;
  }


  .feeling-buttons {
    overflow-x: auto;
    justify-content: flex-start;
  }


  .feeling-button {
    min-width: 67px;
  }


  .page-heading h2 {
    font-size: 26px;
  }


  .page-intro {
    padding: 18px;
  }


  .hoppy-card {
    align-items: flex-start;
  }


  .hoppy-character {
    width: 60px;
    height: 60px;
    font-size: 34px;
  }


  .hoppy-input-area {
    flex-direction: column;
  }


  .hoppy-input-area button {
    width: 100%;
    min-height: 45px;
  }


  .message-form {
    flex-direction: column;
  }


  .message-form button {
    min-height: 45px;
  }


  .room-message {
    max-width: 90%;
  }


}