body {
  font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic Pro', 'Meiryo', 'Arial', sans-serif;
  background: #f9fafb;
  margin: 0;
  padding: 0;
}

.container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  gap: 0;
  padding: 40px 20px;
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
  box-sizing: border-box;
}

.panel {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 12px 0 rgba(200,200,200,0.10);
  padding: 32px 28px 28px 28px;
  min-width: 250px;
  margin: 0 0;
  flex: 0 0 auto;
}

.panel.left {
  margin-right: 16px;
}

.panel.right {
  margin-left: 16px;
}

.panel input {
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  background: #fcfcfc;
  font-size: 15px;
  padding: 10px;
  margin-bottom: 12px;
  width: 100%;
  box-sizing: border-box;
  transition: border 0.2s;
}

#code {
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  background: #fcfcfc;
  font-size: 15px;
  line-height: 1.5;
  padding: 10px;
  margin-bottom: 12px;
  width: 100%;
  min-width: 300px;
  min-height: 220px;
  height: 260px;
  box-sizing: border-box;
  transition: border 0.2s;
  resize: vertical;
  font-family: 'Fira Mono', 'Menlo', 'Consolas', 'monospace';
}

.panel input:focus, .panel textarea:focus {
  border: 1.5px solid #a5d8ff;
  outline: none;
}

.panel label {
  font-size: 13px;
  color: #888;
  margin-bottom: 4px;
  display: block;
}

.btn {
  padding: 8px 18px;
  margin-top: 8px;
  border: none;
  border-radius: 8px;
  background: #e3eafc;
  color: #2d3a4a;
  font-weight: bold;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 1px 4px 0 rgba(180, 190, 210, 0.10);
  transition: background 0.2s;
}

.btn:hover {
  background: #c7d6ee;
}

.btn#consult-ai {
  background: #e3f6ff;
  color: #1971c2;
  margin-left: 8px;
}

.btn#consult-ai:hover {
  background: #b6e0fe;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn.loading {
  position: relative;
  color: transparent;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid transparent;
  border-top-color: #1971c2;
  border-radius: 50%;
  animation: button-loading-spinner 0.6s linear infinite;
}

@keyframes button-loading-spinner {
  from { transform: rotate(0turn); }
  to { transform: rotate(1turn); }
}

.cute-title {
  font-size: 2.1rem;
  font-weight: 700;
  color: #1971c2;
  margin-bottom: 8px;
  letter-spacing: 1px;
  font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic Pro', 'Meiryo', 'Arial', sans-serif;
}

.cute-desc {
  font-size: 1.1rem;
  color: #868e96;
  margin-bottom: 18px;
}

.output-title {
  font-size: 1.1rem;
  color: #1971c2;
  margin-bottom: 6px;
  margin-top: 18px;
  font-weight: 600;
}

pre {
  background: #f6f8fa;
  padding: 14px;
  border-radius: 10px;
  overflow: auto;
  font-size: 15px;
  font-family: 'Fira Mono', 'Menlo', 'Consolas', 'monospace';
  color: #495057;
  min-height: 36px;
}

/* Console styling */
.console-container {
  background: #1e1e1e;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.console-header {
  background: #323232;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.console-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.console-dot.red { background: #ff5f56; }
.console-dot.yellow { background: #ffbd2e; }
.console-dot.green { background: #27c93f; }

.console-title {
  margin-left: 8px;
  color: #999;
  font-size: 12px;
  font-family: 'Fira Mono', 'Menlo', 'Consolas', 'monospace';
}

.console-output {
  padding: 12px;
  min-height: 200px;
  max-height: 400px;
  overflow-y: auto;
  font-family: 'Fira Mono', 'Menlo', 'Consolas', 'monospace';
  font-size: 14px;
  line-height: 1.5;
}

.console-line {
  margin: 2px 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.console-line.command {
  color: #4ec9b0;
}

.console-line.output {
  color: #d4d4d4;
}

.console-line.error {
  color: #f48771;
}

.console-line.input {
  color: #ffffff;
  font-weight: 500;
  background: #2d2d30;
  padding: 4px 8px;
  border-radius: 3px;
  margin: 2px 0;
}

.console-line.info {
  color: #858585;
}

.console-input-container {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: #1e1e1e;
  border-top: 1px solid #3e3e3e;
  border-radius: 4px;
  margin: 4px 0;
}

.console-prompt {
  color: #4ec9b0;
  font-family: 'Fira Mono', 'Menlo', 'Consolas', 'monospace';
  font-size: 14px;
  margin-right: 8px;
}

.console-input {
  flex: 1;
  background: #776c6c;
  border: none;
  color: #333030;
  font-family: 'Fira Mono', 'Menlo', 'Consolas', 'monospace';
  font-size: 14px;
  outline: none;
  font-weight: 500;
}

.console-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Blinking cursor animation */
@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.console-input:not(:disabled)::after {
  content: '';
  animation: blink 1s infinite;
}

.hint-cute {
  background: #f0f4fa;
  border-left: 5px solid #1971c2;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 1.05rem;
  color: #2d3a4a;
}

.ai-cute {
  background: #e3fafc;
  border-left: 5px solid #1971c2;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 1.05rem;
  color: #1971c2;
}

/* Styling for markdown content in AI assistant */
.ai-cute p {
  margin: 0.5em 0;
}

.ai-cute ul, .ai-cute ol {
  margin: 0.5em 0;
  padding-left: 1.5em;
}

.ai-cute li {
  margin: 0.3em 0;
}

.ai-cute strong {
  font-weight: 600;
  color: #0c5d8f;
}

.ai-cute code {
  background: #ffffff;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Fira Mono', 'Menlo', 'Consolas', 'monospace';
  font-size: 0.95em;
  color: #0c5d8f;
}

.ai-cute pre {
  background: #ffffff;
  padding: 8px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 0.5em 0;
}

.ai-cute pre code {
  background: none;
  padding: 0;
}

/* Scoring results styling */
.scoring-cute {
  background: #fff3cd;
  border-left: 5px solid #856404;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 1.05rem;
  color: #856404;
}

.scoring-cute .score-display {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 8px;
}

.scoring-cute .score-excellent { color: #28a745; }
.scoring-cute .score-good { color: #17a2b8; }
.scoring-cute .score-fair { color: #ffc107; }
.scoring-cute .score-poor { color: #dc3545; }

.scoring-cute .requirements-list {
  margin: 8px 0;
  padding-left: 20px;
}

.scoring-cute .requirements-list li {
  margin: 4px 0;
}

.scoring-cute .requirements-met {
  color: #28a745;
}

.scoring-cute .requirements-missed {
  color: #dc3545;
}

/* Resizable splitter */
.splitter {
  width: 8px;
  background: #e0e0e0;
  cursor: col-resize;
  position: relative;
  transition: background-color 0.2s;
  border-radius: 4px;
  margin: 0 8px;
  min-height: 400px;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 80px;
  margin-bottom: 0px;
}

.splitter:hover {
  background: #1971c2;
}

.splitter:active {
  background: #0c5d8f;
}

.splitter::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 1px;
  height: 20px;
  background: #999;
  border-radius: 0.5px;
  box-shadow: -2px 0 0 #999, 2px 0 0 #999;
}

.splitter:hover::before {
  background: #fff;
  box-shadow: -2px 0 0 #fff, 2px 0 0 #fff;
}

@media (max-width: 900px) {
  .container { 
    flex-direction: column; 
    align-items: stretch; 
    gap: 0; 
    padding: 0; 
  }
  .panel { 
    max-width: 100vw; 
    min-width: 0; 
    border-radius: 0; 
    box-shadow: none; 
    margin: 0 !important;
    width: 100% !important;
  }
  .splitter { 
    display: none; 
  }
}

/* User Profile & Login Styles */
.user-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 1000;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 18px;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 600;
  font-size: 14px;
  color: #2d3a4a;
}

.user-stats {
  font-size: 12px;
  color: #888;
}

.login-btn, .logout-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.login-btn {
  background: #667eea;
  color: white;
}

.login-btn:hover {
  background: #5568d3;
}

.logout-btn {
  background: #f1f3f5;
  color: #495057;
}

.logout-btn:hover {
  background: #e9ecef;
}

/* Login Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  padding: 32px;
  border-radius: 12px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.modal-title {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 8px;
  color: #2d3a4a;
}

.modal-desc {
  color: #888;
  margin-bottom: 24px;
  font-size: 14px;
}

.modal-input {
  width: 100%;
  padding: 12px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: 15px;
  margin-bottom: 12px;
  box-sizing: border-box;
}

.modal-input:focus {
  border-color: #667eea;
  outline: none;
}

.modal-buttons {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.auth-links {
  text-align: center;
  margin-top: 15px;
}

.auth-links a {
  color: #666;
  text-decoration: none;
  font-size: 14px;
}

.auth-links a:hover {
  color: #333;
  text-decoration: underline;
}

.modal-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-btn.primary {
  background: #667eea;
  color: white;
}

.modal-btn.primary:hover {
  background: #5568d3;
}

.modal-btn.secondary {
  background: #f1f3f5;
  color: #495057;
}

.modal-btn.secondary:hover {
  background: #e9ecef;
}

/* Badges Panel */
.badges-panel {
  background: white;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(200,200,200,0.1);
}

.badges-title {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 8px;
  color: #2d3a4a;
}

.badges-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.badge-item {
  background: #f8f9fa;
  border-radius: 6px;
  padding: 4px 8px;
  text-align: center;
  transition: all 0.2s;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: auto;
  white-space: nowrap;
}

.badge-item.earned {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  border-color: #f5576c;
}

.badge-item.locked {
  opacity: 0.5;
}

.badge-icon {
  font-size: 16px;
  margin: 0;
}

.badge-name {
  font-size: 10px;
  font-weight: 600;
  margin: 0;
  line-height: 1;
}

.badge-progress {
  font-size: 8px;
  color: #888;
  margin: 0;
  line-height: 1;
}

.badge-item.earned .badge-progress {
  color: rgba(255,255,255,0.8);
}

/* Adjust container for user bar */
.container {
  padding-top: 80px;
}

/* Celebration Badge */
.badge-celebration {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: white;
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  z-index: 3000;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.badge-celebration.show {
  transform: translate(-50%, -50%) scale(1);
}

.badge-celebration-icon {
  font-size: 80px;
  margin-bottom: 16px;
}

.badge-celebration-title {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 8px;
  color: #2d3a4a;
}

.badge-celebration-desc {
  font-size: 14px;
  color: #888;
}

/* Login required overlay styles */
.login-required-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  backdrop-filter: blur(5px);
}

.login-required-content {
  background: white;
  padding: 40px;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  max-width: 400px;
  width: 90%;
}

.login-required-icon {
  font-size: 48px;
  margin-bottom: 20px;
}

.login-required-title {
  font-size: 24px;
  font-weight: bold;
  color: #2d3a4a;
  margin-bottom: 12px;
}

.login-required-desc {
  font-size: 16px;
  color: #666;
  margin-bottom: 30px;
  line-height: 1.5;
}

.login-required-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 25px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.login-required-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Demo Mode Banner */
#demo-mode-banner {
  background: linear-gradient(135deg, #ff9800, #ff5722);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(255,152,0,0.3);
}

/* Code error highlighting */
.code-error-highlight { 
  background: repeating-linear-gradient(180deg, #fff 0, #fff 90%, #ffe3e3 90%, #ffe3e3 100%); 
}
