:root {
  --bg-dark: #121214; 
  --primary: #767fe8; 
  --primary-hover: #5e68d6;
  --success: #10b981;
  --success-hover: #059669;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --text-main: #ffffff;
  --text-muted: #9ca3af;
  --text-outline: #25284b; 
  
  --border-color: #3b3f8c;
  --panel-bg: #1a1b23; 
}

/* Base Body */
body {
  margin: 0;
  padding: 0;
  font-family: 'Outfit', 'Noto Sans JP', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: hidden; /* 横スクロールを防止 */
  position: relative;
}

/* Background Decorations layer (Dot pattern, 視覚的グラデーションなし) */
.cyber-bg-layer {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 0;
  overflow: hidden;
  background-image: radial-gradient(circle at 1px 1px, #ffffff 1px, transparent 1px); 
  background-size: 40px 40px;
  background-position: -19px -19px;
  opacity: 0.1;
}

/* Giant slanted purple polygon for cyber flat look */
.bg-slant-purple {
  position: fixed;
  top: -10%;
  right: -10%;
  width: 90%;
  height: 120%;
  background-color: var(--primary);
  clip-path: polygon(30% 0, 100% 0, 100% 100%, 0% 100%);
  z-index: 1;
}

/* App layer */
#app {
  width: 100%;
  max-width: 1200px;
  min-height: 100vh;
  position: relative;
  z-index: 10; 
  display: flex;
  flex-direction: column;
  padding: 3rem 2rem;
  box-sizing: border-box;
}

/* Flat Tech Panels */
.tech-panel {
  background-color: var(--panel-bg);
  border: 4px solid var(--border-color);
  padding: 1.5rem;
  box-sizing: border-box;
}

/* Utilities */
.hidden { display: none !important; }

/* Form Inputs */
.cyber-input {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 4px solid var(--border-color);
  background: var(--bg-dark);
  color: white;
  font-size: 1.1rem;
  font-weight: 700;
  box-sizing: border-box;
  font-family: 'Outfit', 'Noto Sans JP', sans-serif;
  transition: border-color 0.1s;
}
.cyber-input:focus {
  outline: none;
  border-color: var(--primary);
}

.games-panel {
  /* スラント図形の上に配置された際の視認性確保 */
  background-color: rgba(26, 27, 35, 0.95); 
}

/* Typography styles */
.tech-header {
  margin-bottom: 3rem;
}

.tech-title {
  margin: 0;
  font-size: 4rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: var(--primary);
  text-shadow: 4px 4px 0 var(--text-outline);
}

.text-white {
  color: var(--text-main);
}

.tech-subtitle {
  margin: 1rem 0 0 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 2px;
  background-color: var(--text-outline);
  display: inline-block;
  padding: 0.4rem 1.2rem;
  border-left: 6px solid var(--primary);
}

/* Section Heading */
.panel-heading {
  margin: 0 0 2rem 0;
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--text-main);
  border-bottom: 4px solid var(--border-color);
  padding-bottom: 0.5rem;
  display: inline-block;
  letter-spacing: 2px;
}

/* Grid layout for games */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.game-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.1s ease-out;
}

.game-card-link:hover:not(.disabled) {
  transform: translateY(-8px);
}

.game-card-link:hover:not(.disabled) .game-card {
  border-color: var(--primary);
  box-shadow: 8px 8px 0 var(--text-outline);
}

.game-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: all 0.1s;
  background-color: var(--bg-dark);
}

.game-title {
  margin: 0 0 1rem 0;
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--primary);
  border-bottom: 2px dashed var(--border-color);
  padding-bottom: 0.5rem;
}

.game-desc {
  margin: 0 0 2rem 0;
  font-size: 1rem;
  color: var(--text-muted);
  flex-grow: 1;
  line-height: 1.5;
  font-weight: 700;
}

/* Buttons */
.btn {
  padding: 0.9rem 1.5rem;
  border: none;
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 2px;
  cursor: pointer;
  color: white;
  text-transform: uppercase;
  border-radius: 0;
  transition: transform 0.1s, background-color 0.2s;
  display: block;
  text-align: center;
}

.btn:active { transform: translateY(2px); }
.btn.primary { background-color: var(--primary); border: 2px solid transparent; }
.btn.primary:hover { background-color: var(--primary-hover); }

/* Disabled state */
.game-card-link.disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.btn.disabled { 
  opacity: 0.5; 
  box-shadow: none; 
  cursor: not-allowed; 
  transform: none; 
  background-color: var(--border-color); 
}

/* Responsive adjust */
@media (max-width: 768px) {
  .tech-title { font-size: 2.5rem; }
  #app { padding: 2rem 1rem; }
  .panel-heading { font-size: 2rem; }
  .games-grid { grid-template-columns: 1fr; }
}
