:root {
    --bg-color: #0d1117;
    --surface: #161b22;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --accent: #58a6ff;
    
    /* Gimmick colors */
    --tower-red: #ff4b82;   /* Pinkish red */
    --tower-blue: #4facfe;  /* Light blue */
    --color-far: #1bd2aa;   /* Greenish blue */
    --color-default: #8b949e; 
    
    --card-bg: rgba(22, 27, 34, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 1rem 0.5rem;
    font-family: 'Noto Sans JP', sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(0, 242, 254, 0.05), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(254, 74, 144, 0.05), transparent 25%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

header {
    text-align: center;
    margin-bottom: 0.5rem;
}

h1 {
    font-size: 1.5rem;
    font-weight: 900;
    margin: 0 0 0.5rem 0;
    background: linear-gradient(135deg, #fff 0%, #8b949e 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 20px rgba(255,255,255,0.1);
}

header p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 1rem;
}

/* Controls */
.controls {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

h2 {
    font-size: 1.2rem;
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    font-weight: 700;
}

.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.role-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    font-family: inherit;
}

.role-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.role-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(88, 166, 255, 0.4);
}

/* Flow Container */
.flow-container {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    position: relative;
    padding: 0;
}

.card-wrapper {
    display: flex;
    align-items: stretch;
    position: relative;
    z-index: 1;
    animation: fadeIn 0.5s ease backwards;
}



/* Base Card Style */
.card {
    flex-grow: 1;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    position: relative;
}

.card:hover {
    transform: translateX(5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Top Glow Line for specific card types */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--strip-color, transparent);
    box-shadow: 0 0 10px var(--strip-color, transparent);
}

.card.type-near {
    --strip-color: transparent;
}
.card.type-near::before {
    background: linear-gradient(90deg, #42f575, #ff4b4b);
    box-shadow: 0 0 10px rgba(255, 75, 75, 0.4);
}
.card.type-near .card-title {
    background: linear-gradient(90deg, #42f575, #ff4b4b);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}
.card.type-far { --strip-color: var(--color-far); }
/* Circle and Share --strip-color will be assigned dynamically via style attribute */

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: var(--strip-color);
    text-shadow: 0 0 10px rgba(255,255,255,0.1);
}

.card-body ol {
    margin: 0;
    padding-left: 1.2rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.card-body li {
    margin-bottom: 0.25rem;
}

.card-body li:last-child {
    margin-bottom: 0;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ensure smooth reordering in JS */
.v-leave-active,
.v-enter-active {
  transition: all 0.5s ease;
}
.v-enter-from,
.v-leave-to {
  opacity: 0;
  transform: translateX(-30px);
}

@media (max-width: 600px) {
    .card-wrapper {
        flex-direction: column;
        gap: 0.5rem;
    }

}

/* Color Mapping controls */
.color-mapping {
    margin-bottom: 0.8rem;
}

.color-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.color-group {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.color-label {
    font-weight: 700;
    font-size: 1.1rem;
    width: 30px;
    text-align: right;
    color: var(--text-primary);
}

.color-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    min-width: 100px;
}

.color-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.red-btn.active {
    background: var(--tower-red);
    border-color: var(--tower-red);
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 75, 130, 0.4);
}

.blue-btn.active {
    background: var(--tower-blue);
    border-color: var(--tower-blue);
    color: #fff;
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.4);
}

.separator {
    border: none;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0.8rem 0;
}

.reset-container {
    margin-bottom: 0.8rem;
}

.reset-btn {
    background: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.reset-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: #fff;
}
