/* ========== GLOBAL VARIABLES ========== */
:root {
  --cyber-bg: #060b14;
  --cyber-dark: #0a1628;
  --cyber-navy: #0b192c;
  --cyber-cyan: #00e5ff;
  --cyber-cyan2: #00b8d4;
  --cyber-purple: #7c3aed;
  --cyber-purple2: #6d28d9;
  --cyber-pink: #f0abfc;
  --cyber-green: #00ff88;
  --cyber-yellow: #ffd700;
  --cyber-red: #ff2d55;
  --text-main: #e2e8f0;
  --text-sub: #94a3b8;
  --text-dim: #64748b;
  --border-glow: rgba(0, 229, 255, 0.3);
  --card-bg: rgba(10, 22, 40, 0.9);
  --card-border: rgba(0, 229, 255, 0.15);
  --input-bg: rgba(6, 11, 20, 0.8);
}

/* ========== RESET & BASE ========== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background: var(--cyber-bg);
  color: var(--text-main);
  font-family: 'Noto Sans JP', 'Yu Gothic', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

body {
  background-image:
    radial-gradient(ellipse at 10% 20%, rgba(124, 58, 237, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 80%, rgba(0, 229, 255, 0.08) 0%, transparent 50%),
    linear-gradient(180deg, #060b14 0%, #0a1020 100%);
  background-attachment: fixed;
}

/* ========== LOADING SCREEN ========== */
.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--cyber-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-logo {
  text-align: center;
  margin-bottom: 40px;
  animation: pulse-glow 2s ease-in-out infinite;
}

.logo-text {
  font-family: 'Orbitron', monospace;
  font-size: clamp(1.4rem, 8vw, 2.5rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--cyber-cyan), var(--cyber-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: clamp(1px, 1vw, 4px);
  text-transform: uppercase;
  padding: 0 16px;
  word-break: break-word;
  white-space: nowrap;
}

.logo-sub {
  font-family: 'Orbitron', monospace;
  font-size: 1.2rem;
  color: var(--cyber-cyan);
  letter-spacing: 8px;
  margin-top: 8px;
  text-shadow: 0 0 20px var(--cyber-cyan);
}

.loading-bar-wrap {
  width: min(300px, 80vw);
  height: 4px;
  background: rgba(0,229,255,0.15);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 16px;
}

.loading-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyber-purple), var(--cyber-cyan));
  border-radius: 2px;
  animation: loading-progress 2s ease-in-out forwards;
  box-shadow: 0 0 10px var(--cyber-cyan);
}

.loading-text {
  font-family: 'Orbitron', monospace;
  font-size: 0.7rem;
  color: var(--cyber-cyan);
  letter-spacing: 4px;
  animation: blink 1s step-end infinite;
}

@keyframes loading-progress {
  0% { width: 0%; }
  100% { width: 100%; }
}

@keyframes blink {
  50% { opacity: 0; }
}

@keyframes pulse-glow {
  0%, 100% { filter: drop-shadow(0 0 20px rgba(0,229,255,0.3)); }
  50% { filter: drop-shadow(0 0 40px rgba(124,58,237,0.5)); }
}

@keyframes neon-flicker {
  0%, 95%, 100% { opacity: 1; }
  96% { opacity: 0.8; }
  97% { opacity: 1; }
  98% { opacity: 0.7; }
}

@keyframes slide-in-up {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes slide-in-right {
  from { transform: translateX(-30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scanline {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ========== LAYOUT ========== */
#app {
  min-height: 100vh;
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
  animation: fadeIn 0.5s ease;
}

/* ========== HEADER / NAVBAR ========== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 11, 20, 0.97);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border-glow);
  padding: 0 16px;
  box-shadow: 0 2px 20px rgba(0, 229, 255, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  max-width: 1400px;
  margin: 0 auto;
  gap: 8px;
}

/* ===== ロゴ ===== */
.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
}

.header-logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--cyber-purple), var(--cyber-cyan));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: white;
  box-shadow: 0 0 12px rgba(124,58,237,0.5);
  flex-shrink: 0;
}

.header-logo-text {
  font-family: 'Orbitron', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--cyber-cyan), var(--cyber-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 1.5px;
  white-space: nowrap;
}

.header-master-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(250,204,21,0.2), rgba(251,146,60,0.2));
  border: 1px solid rgba(250,204,21,0.4);
  color: #fbbf24;
  letter-spacing: 1px;
  white-space: nowrap;
}

/* ===== ヘッダーナビ ===== */
.header-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  justify-content: center;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0 4px;
}
.header-nav::-webkit-scrollbar { display: none; }

.header-nav-btn {
  background: transparent;
  border: none;
  color: rgba(148,163,184,0.85);
  padding: 6px 9px;
  border-radius: 7px;
  font-size: 0.73rem;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: 'Noto Sans JP', sans-serif;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 46px;
  position: relative;
}
.header-nav-btn i {
  font-size: 0.95rem;
  line-height: 1;
}
.header-nav-btn span {
  font-size: 0.62rem;
  line-height: 1;
  font-weight: 500;
}

.header-nav-btn:hover {
  color: var(--cyber-cyan);
  background: rgba(0,229,255,0.07);
}
.header-nav-btn.active {
  color: var(--cyber-cyan);
  background: rgba(0,229,255,0.1);
}
.header-nav-btn.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 2px;
  background: var(--cyber-cyan);
  border-radius: 2px;
}

/* ===== ユーザーエリア ===== */
.header-user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--cyber-cyan);
  object-fit: cover;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0,229,255,0.3);
  flex-shrink: 0;
}

.user-avatar-placeholder {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--cyber-purple);
  background: linear-gradient(135deg, var(--cyber-purple2), var(--cyber-navy));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--cyber-pink);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(124,58,237,0.4);
  flex-shrink: 0;
}

.logout-btn {
  background: transparent;
  border: 1px solid rgba(255,45,85,0.3);
  color: var(--cyber-red);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Noto Sans JP', sans-serif;
  flex-shrink: 0;
}

.logout-btn:hover {
  background: rgba(255,45,85,0.1);
  border-color: var(--cyber-red);
  box-shadow: 0 0 8px rgba(255,45,85,0.2);
}

/* ========== MAIN CONTENT ========== */
.main-content {
  flex: 1;
  padding: 24px 20px;
  animation: slide-in-up 0.4s ease;
}

/* ========== PAGE TITLE ========== */
.page-title {
  font-family: 'Orbitron', monospace;
  font-size: 1.4rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--cyber-cyan), var(--cyber-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 3px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-title-icon {
  -webkit-text-fill-color: var(--cyber-cyan);
  font-size: 1.2rem;
  text-shadow: 0 0 15px var(--cyber-cyan);
}

.page-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--cyber-cyan), transparent);
  opacity: 0.4;
}

/* ========== CARDS ========== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyber-cyan), transparent);
  opacity: 0.6;
}

.card:hover {
  border-color: rgba(0,229,255,0.3);
  box-shadow: 0 8px 32px rgba(0,229,255,0.08);
  transform: translateY(-1px);
}

.card-title {
  font-family: 'Orbitron', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--cyber-cyan);
  letter-spacing: 2px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
}

.card-title i {
  font-size: 1rem;
}

.sec-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--cyber-purple), var(--cyber-purple2));
  color: var(--cyber-pink);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 3px 10px;
  clip-path: polygon(0 0, 100% 0, 92% 100%, 0% 100%);
  padding-right: 18px;
  text-transform: uppercase;
  margin-bottom: 4px;
  font-family: 'Orbitron', monospace;
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  border: none;
  font-family: 'Noto Sans JP', sans-serif;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyber-purple), var(--cyber-purple2));
  color: white;
  box-shadow: 0 0 20px rgba(124,58,237,0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(124,58,237,0.6), 0 8px 20px rgba(0,0,0,0.3);
}

.btn-cyan {
  background: linear-gradient(135deg, var(--cyber-cyan), var(--cyber-cyan2));
  color: #060b14;
  box-shadow: 0 0 20px rgba(0,229,255,0.4);
  font-weight: 900;
}

.btn-cyan:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(0,229,255,0.6), 0 8px 20px rgba(0,0,0,0.3);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--cyber-cyan);
  color: var(--cyber-cyan);
}

.btn-outline:hover {
  background: rgba(0,229,255,0.1);
  box-shadow: 0 0 15px rgba(0,229,255,0.2);
}

.btn-ghost {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-sub);
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
  color: var(--text-main);
}

.btn-danger {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: white;
  box-shadow: 0 0 15px rgba(220,38,38,0.3);
}

.btn-danger:hover {
  box-shadow: 0 0 25px rgba(220,38,38,0.5);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-full {
  width: 100%;
}

/* ========== FORMS ========== */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--cyber-cyan);
  letter-spacing: 1px;
  margin-bottom: 8px;
  text-transform: uppercase;
  font-family: 'Orbitron', monospace;
}

.form-input {
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  background: var(--input-bg);
  border: 1px solid rgba(0,229,255,0.2);
  border-radius: 8px;
  color: var(--text-main);
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: 'Noto Sans JP', sans-serif;
  transition: all 0.25s;
  outline: none;
}
input[type="date"].form-input {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  box-sizing: border-box;
}

.form-input:focus {
  border-color: var(--cyber-cyan);
  box-shadow: 0 0 0 2px rgba(0,229,255,0.15), 0 0 15px rgba(0,229,255,0.1);
  background: rgba(0,229,255,0.03);
}

/* select.form-input は form-select と同じ紺色スタイルに統一 */
select.form-input {
  background-color: rgba(0, 100, 160, 0.25);
  border: 1.5px solid rgba(0, 229, 255, 0.4);
  color: #e2f8ff;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2300e5ff' d='M0 0l6 8 6-8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
  padding-right: 36px;
  cursor: pointer;
}
select.form-input:focus {
  border-color: var(--cyber-cyan);
  background-color: rgba(0, 120, 200, 0.3);
}
select.form-input option {
  background: #0a1628;
  color: #e2f8ff;
}

.form-input::placeholder {
  color: var(--text-dim);
}

textarea.form-input {
  resize: vertical;
  min-height: 80px;
  line-height: 1.6;
}

/* ========== CHECKBOX CUSTOM ========== */
.check-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 8px 16px;
  border: 1px solid rgba(0,229,255,0.2);
  border-radius: 8px;
  transition: all 0.2s;
  background: rgba(0,229,255,0.03);
}

.check-label:hover {
  border-color: var(--cyber-cyan);
  background: rgba(0,229,255,0.08);
}

.check-label input[type="checkbox"],
.check-label input[type="radio"] {
  display: none;
}

.check-box {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0,229,255,0.4);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  background: rgba(0,0,0,0.3);
}

.check-label.checked {
  border-color: var(--cyber-cyan);
  background: rgba(0,229,255,0.12);
  color: var(--cyber-cyan);
  font-weight: 700;
}

.check-label.checked .check-box {
  background: var(--cyber-cyan);
  border-color: var(--cyber-cyan);
}

.check-label.checked .check-box::after {
  content: '✓';
  color: #060b14;
  font-weight: 900;
  font-size: 0.75rem;
}

/* Radio style */
.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 8px 16px;
  border: 1px solid rgba(124,58,237,0.3);
  border-radius: 8px;
  transition: all 0.2s;
  background: rgba(124,58,237,0.03);
}

.radio-label:hover {
  border-color: var(--cyber-purple);
  background: rgba(124,58,237,0.08);
}

.radio-label.checked {
  border-color: var(--cyber-purple);
  background: rgba(124,58,237,0.15);
  color: var(--cyber-pink);
  font-weight: 700;
  box-shadow: 0 0 10px rgba(124,58,237,0.2);
}

/* ========== RATING SCALE ========== */
.rating-section {
  background: rgba(0,229,255,0.03);
  border: 1px solid rgba(0,229,255,0.15);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  position: relative;
}

.rating-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 12px;
  font-family: 'Orbitron', monospace;
}

.rating-scale {
  display: flex;
  justify-content: space-around;
  gap: 8px;
}

.rating-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.2s;
  flex: 1;
}

.rating-item:hover {
  border-color: rgba(0,229,255,0.3);
  background: rgba(0,229,255,0.05);
}

.rating-item.selected {
  border-color: var(--cyber-cyan);
  background: rgba(0,229,255,0.15);
  box-shadow: 0 0 15px rgba(0,229,255,0.2);
}

.rating-num {
  font-family: 'Orbitron', monospace;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text-dim);
  transition: all 0.2s;
}

.rating-item.selected .rating-num {
  color: var(--cyber-cyan);
  text-shadow: 0 0 15px var(--cyber-cyan);
}

.rating-circle {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(0,229,255,0.3);
  border-radius: 50%;
  transition: all 0.2s;
  background: rgba(0,0,0,0.3);
}

.rating-item.selected .rating-circle {
  border-color: var(--cyber-cyan);
  background: var(--cyber-cyan);
  box-shadow: 0 0 10px var(--cyber-cyan);
}

/* ========== LOGIN PAGE ========== */
.login-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background-image:
    radial-gradient(ellipse at 20% 30%, rgba(124,58,237,0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 70%, rgba(0,229,255,0.1) 0%, transparent 60%);
}

.login-hero {
  text-align: center;
  margin-bottom: 48px;
  animation: slide-in-up 0.6s ease;
}

.login-hero-title {
  font-family: 'Orbitron', monospace;
  font-size: clamp(1.8rem, 6vw, 3.5rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--cyber-cyan) 0%, var(--cyber-purple) 60%, var(--cyber-pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 4px;
  line-height: 1.2;
  animation: neon-flicker 4s ease-in-out infinite;
  text-shadow: none;
}

.login-hero-sub {
  font-family: 'Orbitron', monospace;
  font-size: clamp(0.9rem, 3vw, 1.3rem);
  color: var(--cyber-cyan);
  letter-spacing: 8px;
  margin-top: 10px;
  text-shadow: 0 0 20px var(--cyber-cyan);
  animation: pulse-glow 2s ease-in-out infinite;
}

.login-tagline {
  font-size: 0.85rem;
  color: var(--text-sub);
  margin-top: 16px;
  letter-spacing: 2px;
}

.login-card {
  background: rgba(10, 22, 40, 0.95);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 420px;
  position: relative;
  box-shadow: 0 0 60px rgba(0,229,255,0.05), 0 20px 60px rgba(0,0,0,0.5);
  animation: slide-in-up 0.8s ease;
  backdrop-filter: blur(20px);
}

.login-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyber-cyan), var(--cyber-purple), transparent);
}

.login-tabs {
  display: flex;
  gap: 4px;
  background: rgba(0,0,0,0.3);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 28px;
}

.login-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-dim);
  border: none;
  background: transparent;
  font-family: 'Noto Sans JP', sans-serif;
}

.login-tab.active {
  background: linear-gradient(135deg, var(--cyber-purple), var(--cyber-purple2));
  color: white;
  box-shadow: 0 0 15px rgba(124,58,237,0.4);
}

.facility-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0,229,255,0.08);
  border: 1px solid rgba(0,229,255,0.2);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 20px;
  font-size: 0.8rem;
  color: var(--cyber-cyan);
}

.facility-badge i {
  font-size: 1rem;
  text-shadow: 0 0 10px var(--cyber-cyan);
}

/* ========== HOME / DASHBOARD ========== */
.dashboard-hero {
  background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(0,229,255,0.08));
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.dashboard-hero::after {
  content: '⚡';
  position: absolute;
  right: -10px;
  top: -20px;
  font-size: 8rem;
  opacity: 0.04;
}

.dashboard-greeting {
  font-size: 0.85rem;
  color: var(--text-sub);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: 'Orbitron', monospace;
  margin-bottom: 8px;
}

.dashboard-name {
  font-family: 'Orbitron', monospace;
  font-size: 1.6rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--cyber-cyan), var(--cyber-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

.dashboard-date {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-sub);
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.action-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
}

.action-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  transition: all 0.3s;
}

.action-card.cyan::before { background: linear-gradient(90deg, transparent, var(--cyber-cyan), transparent); }
.action-card.purple::before { background: linear-gradient(90deg, transparent, var(--cyber-purple), transparent); }
.action-card.green::before { background: linear-gradient(90deg, transparent, var(--cyber-green), transparent); }
.action-card.yellow::before { background: linear-gradient(90deg, transparent, var(--cyber-yellow), transparent); }

.action-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}

.action-card.cyan:hover { border-color: var(--cyber-cyan); box-shadow: 0 12px 30px rgba(0,229,255,0.1); }
.action-card.purple:hover { border-color: var(--cyber-purple); box-shadow: 0 12px 30px rgba(124,58,237,0.1); }
.action-card.green:hover { border-color: var(--cyber-green); box-shadow: 0 12px 30px rgba(0,255,136,0.1); }
.action-card.yellow:hover { border-color: var(--cyber-yellow); box-shadow: 0 12px 30px rgba(255,215,0,0.1); }

.action-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.action-card.cyan .action-icon { color: var(--cyber-cyan); text-shadow: 0 0 15px var(--cyber-cyan); }
.action-card.purple .action-icon { color: var(--cyber-purple); text-shadow: 0 0 15px var(--cyber-purple); }
.action-card.green .action-icon { color: var(--cyber-green); text-shadow: 0 0 15px var(--cyber-green); }
.action-card.yellow .action-icon { color: var(--cyber-yellow); text-shadow: 0 0 15px var(--cyber-yellow); }

.action-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.action-sub {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-family: 'Orbitron', monospace;
}

/* ========== HISTORY TABLE ========== */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px;
  transition: all 0.2s;
  cursor: pointer;
}

.history-item:hover {
  border-color: rgba(0,229,255,0.2);
  background: rgba(0,229,255,0.03);
}

.history-date {
  font-family: 'Orbitron', monospace;
  font-size: 0.8rem;
  color: var(--cyber-cyan);
  width: 90px;
  flex-shrink: 0;
}

.history-badges {
  display: flex;
  gap: 6px;
  flex: 1;
  flex-wrap: wrap;
}

.badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: 'Orbitron', monospace;
}

.badge-green { background: rgba(0,255,136,0.15); color: var(--cyber-green); border: 1px solid rgba(0,255,136,0.3); }
.badge-cyan { background: rgba(0,229,255,0.15); color: var(--cyber-cyan); border: 1px solid rgba(0,229,255,0.3); }
.badge-purple { background: rgba(124,58,237,0.15); color: var(--cyber-purple); border: 1px solid rgba(124,58,237,0.3); }
.badge-yellow { background: rgba(255,215,0,0.15); color: var(--cyber-yellow); border: 1px solid rgba(255,215,0,0.3); }
.badge-red { background: rgba(255,45,85,0.15); color: var(--cyber-red); border: 1px solid rgba(255,45,85,0.3); }

/* ========== STATS SECTION ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 16px 12px;
  text-align: center;
  transition: all 0.2s;
}

.stat-card:hover {
  border-color: rgba(0,229,255,0.2);
  transform: translateY(-2px);
}

.stat-value {
  font-family: 'Orbitron', monospace;
  font-size: 1.6rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--cyber-cyan), var(--cyber-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.stat-sub {
  font-size: 0.7rem;
  color: var(--text-sub);
  margin-top: 4px;
}

.chart-container {
  position: relative;
  height: 200px;
  margin: 16px 0;
}

/* ========== PERIOD TOGGLE ========== */
.period-toggle {
  display: flex;
  gap: 4px;
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 16px;
  width: fit-content;
}

.period-btn {
  padding: 6px 20px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: 'Orbitron', monospace;
  letter-spacing: 1px;
}

.period-btn.active {
  background: linear-gradient(135deg, var(--cyber-cyan), var(--cyber-cyan2));
  color: #060b14;
  box-shadow: 0 0 10px rgba(0,229,255,0.3);
}

/* ========== MASTER PANEL ========== */
.master-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(255,215,0,0.2), rgba(255,165,0,0.1));
  border: 1px solid rgba(255,215,0,0.4);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--cyber-yellow);
  letter-spacing: 2px;
  font-family: 'Orbitron', monospace;
  text-shadow: 0 0 10px rgba(255,215,0,0.5);
}

.user-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.user-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-card:hover {
  border-color: var(--cyber-cyan);
  box-shadow: 0 8px 25px rgba(0,229,255,0.1);
  transform: translateY(-2px);
}

.user-card-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(0,229,255,0.3);
  object-fit: cover;
  flex-shrink: 0;
}

.user-card-avatar-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(124,58,237,0.3);
  background: linear-gradient(135deg, var(--cyber-purple2), var(--cyber-navy));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--cyber-pink);
  flex-shrink: 0;
}

.user-card-info {
  flex: 1;
  min-width: 0;
}

.user-card-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 2px;
  truncate: true;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-card-id {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-family: 'Orbitron', monospace;
}

/* ========== COMMENT BOX ========== */
.comment-box {
  background: rgba(124,58,237,0.08);
  border: 1px solid rgba(124,58,237,0.2);
  border-left: 3px solid var(--cyber-purple);
  border-radius: 8px;
  padding: 16px;
  margin-top: 16px;
}

.comment-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--cyber-purple);
  letter-spacing: 1px;
  margin-bottom: 8px;
  font-family: 'Orbitron', monospace;
  display: flex;
  align-items: center;
  gap: 6px;
}

.comment-text {
  font-size: 0.9rem;
  color: var(--cyber-pink);
  line-height: 1.6;
}

/* ========== PROFILE PAGE ========== */
.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.profile-avatar-wrap {
  position: relative;
  cursor: pointer;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--cyber-cyan);
  object-fit: cover;
  box-shadow: 0 0 20px rgba(0,229,255,0.3);
  display: block;
}

.profile-avatar-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--cyber-purple);
  background: linear-gradient(135deg, var(--cyber-purple2), var(--cyber-navy));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--cyber-pink);
  box-shadow: 0 0 20px rgba(124,58,237,0.4);
}

.avatar-upload-hint {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 24px;
  height: 24px;
  background: var(--cyber-cyan);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  color: #060b14;
  font-weight: 900;
}

.profile-meta {
  flex: 1;
}

.profile-name {
  font-family: 'Orbitron', monospace;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.profile-id {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-family: 'Orbitron', monospace;
  letter-spacing: 1px;
}

/* ========== PRINT STYLES ========== */
@media print {
  body {
    background: white !important;
    color: black !important;
  }
  
  .app-header,
  .header-nav,
  .logout-btn,
  .btn:not(.btn-print-trigger),
  .no-print {
    display: none !important;
  }
  
  .print-only {
    display: block !important;
  }
  
  .card {
    border: 1px solid #ccc !important;
    background: white !important;
    box-shadow: none !important;
  }
  
  .page-title {
    color: black !important;
    -webkit-text-fill-color: black !important;
  }
}

.print-only { display: none; }

/* ========== TOAST / NOTIFICATION ========== */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: rgba(10, 22, 40, 0.95);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 0.85rem;
  color: var(--text-main);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slide-in-right 0.3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  pointer-events: auto;
}

.toast.success { border-left: 3px solid var(--cyber-green); }
.toast.error { border-left: 3px solid var(--cyber-red); }
.toast.info { border-left: 3px solid var(--cyber-cyan); }

.toast-icon.success { color: var(--cyber-green); }
.toast-icon.error { color: var(--cyber-red); }
.toast-icon.info { color: var(--cyber-cyan); }

/* ========== CYBER DECORATIVE ========== */
.cyber-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyber-cyan), transparent);
  opacity: 0.3;
  margin: 16px 0;
}

.cyber-corner {
  position: relative;
}

.cyber-corner::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  width: 16px;
  height: 16px;
  border-top: 2px solid var(--cyber-cyan);
  border-left: 2px solid var(--cyber-cyan);
}

.cyber-corner::after {
  content: '';
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 16px;
  height: 16px;
  border-bottom: 2px solid var(--cyber-cyan);
  border-right: 2px solid var(--cyber-cyan);
}

.glitch-text {
  position: relative;
}

/* ========== DIVIDER ========== */
.section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}

.section-divider-line {
  flex: 1;
  height: 1px;
  background: rgba(0,229,255,0.15);
}

.section-divider-text {
  font-family: 'Orbitron', monospace;
  font-size: 0.7rem;
  color: var(--text-dim);
  letter-spacing: 2px;
}

/* ========== MODAL ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-box {
  background: rgba(10, 22, 40, 0.98);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 0 60px rgba(0,229,255,0.1);
  animation: slide-in-up 0.3s ease;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.2s;
  padding: 4px;
}

.modal-close:hover { color: var(--cyber-red); }

/* ========== RESPONSIVE ========== */
@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .user-list-grid {
    grid-template-columns: 1fr;
  }
  
  .header-logo-text {
    font-size: 0.7rem;
    letter-spacing: 1px;
  }
  
  .login-hero-title {
    font-size: 1.8rem;
  }
  
  .main-content {
    padding: 16px 12px;
  }
  
  .login-card {
    padding: 24px 20px;
  }
  
  .check-group {
    flex-direction: column;
  }
  
  .rating-num {
    font-size: 1.2rem;
  }
  
  .page-title {
    font-size: 1rem;
    letter-spacing: 1px;
  }
}

@media (max-width: 380px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .quick-actions {
    grid-template-columns: 1fr;
  }
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,229,255,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,229,255,0.4); }

/* ========== PROGRESS BAR ========== */
.progress-bar-wrap {
  background: rgba(0,0,0,0.3);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
  margin: 8px 0;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease;
}

.progress-cyan { background: linear-gradient(90deg, var(--cyber-cyan2), var(--cyber-cyan)); box-shadow: 0 0 8px var(--cyber-cyan); }
.progress-purple { background: linear-gradient(90deg, var(--cyber-purple2), var(--cyber-purple)); box-shadow: 0 0 8px var(--cyber-purple); }
.progress-green { background: linear-gradient(90deg, #00cc6a, var(--cyber-green)); box-shadow: 0 0 8px var(--cyber-green); }
.progress-yellow { background: linear-gradient(90deg, #e6a800, var(--cyber-yellow)); box-shadow: 0 0 8px var(--cyber-yellow); }
.progress-pink { background: linear-gradient(90deg, #c026d3, var(--cyber-pink)); box-shadow: 0 0 8px var(--cyber-pink); }

/* ========== BACK BUTTON ========== */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-sub);
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.2s;
  border: none;
  background: transparent;
  padding: 0;
  margin-bottom: 16px;
  font-family: 'Noto Sans JP', sans-serif;
}

.back-btn:hover {
  color: var(--cyber-cyan);
}

/* Print sheet styles */
.print-sheet {
  display: none;
}

@media print {
  .print-sheet {
    display: block !important;
    background: white;
    color: black;
    padding: 20mm;
    font-family: 'Noto Sans JP', sans-serif;
  }
  
  .no-print {
    display: none !important;
  }
}

/* Active nav indicator */
.nav-active {
  position: relative;
}

.nav-active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--cyber-cyan);
  border-radius: 1px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-dim);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state-text {
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0,229,255,0.2);
  border-top-color: var(--cyber-cyan);
  border-radius: 50%;
  animation: rotate 0.8s linear infinite;
}

/* Tab content visibility */
.tab-pane { display: none; }
.tab-pane.active { display: block; }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.text-sub { color: var(--text-sub); }
.text-dim { color: var(--text-dim); }
.text-cyan { color: var(--cyber-cyan); }
.text-purple { color: var(--cyber-purple); }
.text-green { color: var(--cyber-green); }
.text-yellow { color: var(--cyber-yellow); }
.text-red { color: var(--cyber-red); }
.font-mono { font-family: 'Orbitron', monospace; }
.w-full { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ========== LEVEL SYSTEM ========== */
.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-family: 'Orbitron', monospace;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 1px;
}
.level-1  { background:rgba(91,217,239,0.15); color:#5bd9ef; border:1px solid #5bd9ef; box-shadow:0 0 8px rgba(91,217,239,0.3); }
.level-10 { background:rgba(242,209,39,0.15); color:#f2d127; border:1px solid #f2d127; box-shadow:0 0 8px rgba(242,209,39,0.3); }
.level-30 { background:rgba(140,82,255,0.15); color:#8c52ff; border:1px solid #8c52ff; box-shadow:0 0 8px rgba(140,82,255,0.3); }
.level-50 { background:rgba(197,47,118,0.15); color:#c52f76; border:1px solid #c52f76; box-shadow:0 0 8px rgba(197,47,118,0.3); }
.level-80 { background:rgba(255,0,0,0.15); color:#ff0000; border:1px solid #ff0000; box-shadow:0 0 8px rgba(255,0,0,0.4); }
.level-99 {
  background: linear-gradient(135deg,rgba(255,0,0,0.2),rgba(255,165,0,0.2),rgba(255,255,0,0.2),rgba(0,255,0,0.2),rgba(0,0,255,0.2),rgba(238,130,238,0.2));
  border: 1px solid transparent;
  background-clip: padding-box;
  animation: rainbow-border 2s linear infinite;
  color: white;
  text-shadow: 0 0 10px gold;
}
@keyframes rainbow-border {
  0%   { box-shadow: 0 0 12px #ff0000; }
  17%  { box-shadow: 0 0 12px #ff8800; }
  33%  { box-shadow: 0 0 12px #ffff00; }
  50%  { box-shadow: 0 0 12px #00ff00; }
  67%  { box-shadow: 0 0 12px #0088ff; }
  83%  { box-shadow: 0 0 12px #ee82ee; }
  100% { box-shadow: 0 0 12px #ff0000; }
}
@keyframes rainbow-text-anim {
  0%   { color: #ff4d4d; }
  14%  { color: #ff9900; }
  28%  { color: #ffee00; }
  42%  { color: #33ff66; }
  57%  { color: #00ccff; }
  71%  { color: #7766ff; }
  85%  { color: #ff44cc; }
  100% { color: #ff4d4d; }
}
/* 虹色テキスト（マスター用） */
.rainbow-text {
  animation: rainbow-text-anim 2.5s linear infinite;
  font-weight: 900;
  filter: drop-shadow(0 0 6px currentColor);
}
.rainbow-text i {
  animation: rainbow-text-anim 2.5s linear infinite;
}
.level-bar-wrap {
  background: rgba(0,0,0,0.4);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
  margin-top: 6px;
}
.level-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s ease;
}
.level-bar-1  { background: linear-gradient(90deg,#3ab5cc,#5bd9ef); box-shadow:0 0 6px #5bd9ef; }
.level-bar-10 { background: linear-gradient(90deg,#c4a800,#f2d127); box-shadow:0 0 6px #f2d127; }
.level-bar-30 { background: linear-gradient(90deg,#6030cc,#8c52ff); box-shadow:0 0 6px #8c52ff; }
.level-bar-50 { background: linear-gradient(90deg,#8a1f52,#c52f76); box-shadow:0 0 6px #c52f76; }
.level-bar-80 { background: linear-gradient(90deg,#cc0000,#ff0000); box-shadow:0 0 6px #ff0000; }
.level-bar-99 { background: linear-gradient(90deg,red,orange,yellow,green,blue,violet); animation:rainbow-border 2s linear infinite; }

/* Master level 99 gold */
.master-level {
  font-family:'Orbitron',monospace;
  font-size:1.2rem;
  font-weight:900;
  background: linear-gradient(135deg,#b8860b,#ffd700,#b8860b);
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  background-clip:text;
  text-shadow:none;
  filter:drop-shadow(0 0 8px gold);
  animation:gold-pulse 2s ease-in-out infinite;
}
@keyframes gold-pulse {
  0%,100% { filter:drop-shadow(0 0 8px gold); }
  50% { filter:drop-shadow(0 0 20px #ffd700); }
}

/* ========== BADGE SYSTEM ========== */
.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
}
.badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.2);
  transition: all 0.2s;
  text-align: center;
}
.badge-item.owned {
  border-color: rgba(0,229,255,0.3);
  background: rgba(0,229,255,0.06);
  box-shadow: 0 0 10px rgba(0,229,255,0.1);
}
.badge-item.owned:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,229,255,0.2);
}
.badge-img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
}
.badge-placeholder {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 2px dashed rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--text-dim);
}
.badge-name {
  font-size: 0.65rem;
  color: var(--text-sub);
  line-height: 1.3;
  word-break: break-all;
}
.badge-item.owned .badge-name { color: var(--cyber-cyan); }

/* ========== STRATEGY SHEET ========== */
.strategy-members {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.member-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.member-row .form-input {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.85rem;
}
.strategy-content-block {
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(0,229,255,0.1);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  position: relative;
}
.add-block-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--cyber-cyan);
  font-size: 0.85rem;
  cursor: pointer;
  background: rgba(0,229,255,0.06);
  border: 1px dashed rgba(0,229,255,0.3);
  border-radius: 8px;
  padding: 10px 16px;
  width: 100%;
  transition: all 0.2s;
}
.add-block-btn:hover { background: rgba(0,229,255,0.12); }

/* ========== FRIEND SYSTEM ========== */
.friend-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  transition: all 0.2s;
}
.friend-card:hover {
  border-color: rgba(0,229,255,0.2);
  background: rgba(0,229,255,0.03);
}
.friend-request-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(124,58,237,0.08);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: 10px;
  margin-bottom: 8px;
}

/* ========== POINTS DISPLAY ========== */
.points-display {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,229,255,0.06);
  border: 1px solid rgba(0,229,255,0.15);
  border-radius: 8px;
  padding: 8px 14px;
}
.points-icon {
  color: var(--cyber-yellow);
  font-size: 1rem;
  text-shadow: 0 0 10px var(--cyber-yellow);
}
.points-value {
  font-family: 'Orbitron', monospace;
  font-size: 1rem;
  font-weight: 900;
  color: var(--cyber-yellow);
}
.points-label {
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* hide-xs on small screens */
@media (max-width: 480px) {
  .hide-xs { display: none !important; }
}

/* ========== ROUND3 ADDITIONS ========== */

/* プルダウン（form-select: 見やすい青みがかった配色） */
.form-select {
  width: 100%;
  background: rgba(0, 100, 160, 0.25);
  border: 1.5px solid rgba(0, 229, 255, 0.4);
  border-radius: 8px;
  color: #e2f8ff;
  padding: 11px 36px 11px 16px;
  font-size: 0.95rem;
  font-family: 'Noto Sans JP', sans-serif;
  transition: all 0.25s;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2300e5ff' d='M0 0l6 8 6-8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
}
.form-select:focus {
  border-color: var(--cyber-cyan);
  box-shadow: 0 0 0 2px rgba(0,229,255,0.2), 0 0 15px rgba(0,229,255,0.1);
  background-color: rgba(0, 120, 200, 0.3);
}
.form-select option {
  background: #0a1628;
  color: #e2f8ff;
  padding: 8px;
}
.form-select option:hover,
.form-select option:checked {
  background: #00344d;
  color: #00e5ff;
}

/* ボタン イエロー */
.btn-yellow {
  background: linear-gradient(135deg, #ffd700, #e6b800);
  color: #1a1a00;
  border: none;
  font-weight: 700;
}
.btn-yellow:hover { background: linear-gradient(135deg, #ffe033, #ffd700); }

/* モーダル */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 16px;
}
.modal-box {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 24px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
.modal-title {
  font-family: 'Orbitron', monospace;
  font-size: 1rem;
  color: var(--cyber-cyan);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1rem;
  z-index: 1;
}
.modal-close:hover { color: var(--cyber-red); }

/* ============================================================
   スマートフォン専用レイアウト（本格対応）
   対象: 幅480px以下のスマホ
   ============================================================ */

/* ---- ボトムナビゲーション（スマホ専用） ---- */
.bottom-nav {
  display: none;
}

@media (max-width: 480px) {
  /* ---- ヘッダー最小化 ---- */
  .app-header {
    padding: 0 10px;
  }
  .header-inner {
    height: 48px;
    gap: 6px;
  }
  .header-logo-icon {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
  }
  .header-logo-text {
    font-size: 0.65rem;
    letter-spacing: 0.5px;
  }
  .header-master-badge {
    font-size: 0.6rem;
    padding: 2px 6px;
  }
  /* ヘッダーナビを非表示（ボトムナビへ移動） */
  .header-nav {
    display: none;
  }
  /* ログアウトボタンはヘッダーに残す（小さく） */
  .logout-btn {
    font-size: 0.65rem;
    padding: 4px 8px;
  }
  /* ボトムドロワーはグローバルで display:block 済み（visibility で制御） */

  /* ---- メインコンテンツ ---- */
  .main-content {
    padding: 12px 10px 100px 10px; /* 下にボトムナビ分の余白 */
  }

  /* ---- カード ---- */
  .card {
    padding: 14px 12px;
    margin-bottom: 12px;
    border-radius: 10px;
  }
  .card-title {
    font-size: 0.82rem;
    margin-bottom: 12px;
  }

  /* ---- ページタイトル ---- */
  .page-title {
    font-size: 0.88rem;
    letter-spacing: 1px;
    margin-bottom: 14px;
  }

  /* ---- ダッシュボードヒーロー ---- */
  .dashboard-hero {
    padding: 16px 14px;
    border-radius: 10px;
  }
  .dashboard-greeting {
    font-size: 0.6rem;
    letter-spacing: 2px;
  }
  .dashboard-name {
    font-size: 1.3rem;
    letter-spacing: 2px;
  }
  .points-display {
    font-size: 0.78rem;
    padding: 4px 10px;
    gap: 4px;
  }
  .points-value {
    font-size: 1.1rem;
  }

  /* ---- クイックアクション（3列→2列） ---- */
  .quick-actions {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .action-card {
    padding: 12px 6px;
    border-radius: 8px;
  }
  .action-icon {
    font-size: 1.3rem;
    margin-bottom: 6px;
  }
  .action-title {
    font-size: 0.7rem;
  }
  .action-sub {
    font-size: 0.55rem;
    letter-spacing: 0;
  }

  /* ---- フォーム要素 ---- */
  .form-group {
    margin-bottom: 14px;
  }
  .form-label {
    font-size: 0.75rem;
    margin-bottom: 6px;
  }
  .form-input, .form-select, .form-textarea {
    font-size: 0.9rem;
    padding: 9px 12px;
    border-radius: 7px;
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
  }
  input[type="date"].form-input {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    box-sizing: border-box;
    font-size: 0.85rem;
  }

  /* ---- ボタン ---- */
  .btn {
    padding: 9px 14px;
    font-size: 0.8rem;
    border-radius: 7px;
  }
  .btn-sm {
    padding: 6px 10px;
    font-size: 0.72rem;
  }
  .btn-full {
    width: 100%;
  }

  /* ---- プロフィール ---- */
  .profile-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }
  .profile-meta {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .profile-name {
    font-size: 1.2rem;
  }
  .profile-avatar {
    width: 80px;
    height: 80px;
  }
  .profile-avatar-placeholder {
    width: 80px;
    height: 80px;
    font-size: 2rem;
  }

  /* ---- バッジグリッド ---- */
  .badge-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .badge-item {
    padding: 8px 4px;
  }
  .badge-img {
    width: 44px;
    height: 44px;
  }
  .badge-name {
    font-size: 0.62rem;
  }

  /* ---- モーダル ---- */
  .modal-box {
    margin: 10px;
    padding: 16px 14px;
    max-width: calc(100vw - 20px) !important;
    max-height: 90vh;
    overflow-y: auto;
  }
  .modal-title {
    font-size: 0.9rem;
    padding-right: 28px;
  }

  /* ---- ユーザーカード（マスター管理） ---- */
  .user-list-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .user-card {
    padding: 12px;
  }
  .user-card-avatar, .user-card-avatar-placeholder {
    width: 40px;
    height: 40px;
  }
  .user-card-name {
    font-size: 0.88rem;
  }
  .user-card-id {
    font-size: 0.7rem;
  }

  /* ---- 統計グリッド ---- */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .stat-card {
    padding: 12px 10px;
  }
  .stat-value {
    font-size: 1.4rem;
  }
  .stat-label {
    font-size: 0.65rem;
  }

  /* ---- ピリオドトグル ---- */
  .period-toggle {
    gap: 4px;
    margin-bottom: 12px;
  }
  .period-btn {
    padding: 6px 12px;
    font-size: 0.75rem;
  }

  /* ---- レベルバッジ ---- */
  .level-badge {
    font-size: 0.62rem;
    padding: 2px 8px;
    letter-spacing: 1px;
  }

  /* ---- ログイン画面 ---- */
  .login-hero-title {
    font-size: 1.5rem;
    letter-spacing: 3px;
  }
  .login-hero-sub {
    font-size: 0.65rem;
    letter-spacing: 3px;
  }
  .login-card {
    padding: 20px 16px;
    border-radius: 12px;
  }
  .tab-btn {
    font-size: 0.72rem;
    padding: 8px 10px;
  }

  /* ---- マスターバッジ ---- */
  .master-badge {
    font-size: 0.65rem;
    padding: 3px 8px;
    letter-spacing: 1px;
  }

  /* ---- コメントボックス ---- */
  .comment-box {
    padding: 10px;
    border-radius: 6px;
  }
  .comment-text {
    font-size: 0.8rem;
  }

  /* ---- フレンドカード ---- */
  .friend-card, .friend-request-card {
    padding: 10px;
    gap: 8px;
  }

  /* ---- チェックグループ（目標シート） ---- */
  .check-group {
    flex-direction: column;
    gap: 8px;
  }
  .check-item {
    padding: 10px 12px;
  }

  /* ---- 評価スター ---- */
  .rating-star {
    font-size: 1.5rem;
  }
  .rating-num {
    font-size: 1rem;
    min-width: 32px;
    height: 32px;
  }

  /* ---- ヘッダーボタン行（マスターユーザー詳細）折り返し ---- */
  [style*="display:flex"][style*="flex-wrap:wrap"][style*="gap:8px"] {
    gap: 6px !important;
  }

  /* ---- ボトムナビ（スマホ専用） ---- */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: rgba(6, 11, 20, 0.98);
    border-top: 1px solid rgba(0, 229, 255, 0.15);
    backdrop-filter: blur(24px);
    padding: 6px 0 max(env(safe-area-inset-bottom, 0px), 16px) 0;
    justify-content: space-around;
    align-items: stretch;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
  }
  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5px 4px 3px;
    cursor: pointer;
    flex: 1;
    border: none;
    background: transparent;
    color: rgba(100,116,139,0.9);
    transition: color 0.18s, background 0.18s;
    gap: 2px;
    font-family: 'Noto Sans JP', sans-serif;
    -webkit-tap-highlight-color: transparent;
    min-height: 50px;
    border-radius: 8px;
    margin: 0 2px;
    position: relative;
  }
  .bottom-nav-item:active {
    background: rgba(0,229,255,0.06);
    transform: scale(0.95);
  }
  .bottom-nav-item.active {
    color: var(--cyber-cyan);
    background: rgba(0,229,255,0.08);
  }
  .bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2px;
    background: var(--cyber-cyan);
    border-radius: 0 0 2px 2px;
  }
  .bottom-nav-item i {
    font-size: 1.15rem;
    line-height: 1;
  }
  .bottom-nav-item span {
    font-size: 0.58rem;
    letter-spacing: 0.3px;
    font-weight: 500;
    line-height: 1;
  }
}

/* ===== ボトムドロワー（スマホ全メニュー） ===== */
.bottom-drawer {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}
.bottom-drawer.open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}
.bottom-drawer-inner {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(8, 14, 28, 0.98);
  border-top: 1px solid rgba(0,229,255,0.2);
  border-radius: 20px 20px 0 0;
  padding: 16px 16px max(env(safe-area-inset-bottom, 0px), 80px) 16px;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.6);
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}
.bottom-drawer.open .bottom-drawer-inner {
  transform: translateY(0);
}
.bottom-drawer-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(148,163,184,0.7);
  margin-bottom: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.bottom-drawer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.bottom-drawer-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 6px;
  border: none;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  color: rgba(148,163,184,0.9);
  cursor: pointer;
  gap: 6px;
  font-family: 'Noto Sans JP', sans-serif;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.18s;
  min-height: 64px;
}
.bottom-drawer-item:active {
  background: rgba(0,229,255,0.1);
  border-color: rgba(0,229,255,0.3);
  color: var(--cyber-cyan);
  transform: scale(0.95);
}
.bottom-drawer-item.active {
  background: rgba(0,229,255,0.08);
  border-color: rgba(0,229,255,0.25);
  color: var(--cyber-cyan);
}
.bottom-drawer-item i {
  font-size: 1.2rem;
  line-height: 1;
}
.bottom-drawer-item span {
  font-size: 0.62rem;
  font-weight: 500;
  line-height: 1;
}

/* ---- 極小画面（iPhone SE等 320px） ---- */
@media (max-width: 360px) {
  .quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }
  .action-title {
    font-size: 0.65rem;
  }
  .badge-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .main-content {
    padding: 10px 8px 100px 8px;
  }
  .dashboard-name {
    font-size: 1.1rem;
  }
}
