body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    text-align: center;
}

.container {
    background-color: #ffffff;
    padding: 2rem 3rem;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    width: 90%;
    max-width: 420px;
    position: relative;
}

h1 {
    position: absolute;
    right: 1.5rem;
    bottom: 1rem;
    margin: 0;
    font-size: 0.75rem;
    font-weight: 400;
    color: #cccccc;
}

button {
    background-color: #1a73e8;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

button:hover {
    background-color: #185abc;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.top-right-controls {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    display: flex;
    gap: 0.5rem;
}

#widgetButton, #greenScreenButton, #disconnectButton {
    background-color: transparent;
    color: #888;
    border: none;
    padding: 0.5rem;
    border-radius: 50%;
    margin-bottom: 0; /* 'button'スタイルの上書き */
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

#widgetButton:hover, #greenScreenButton:hover, #disconnectButton:hover {
    background-color: #e9ecef;
    color: #333;
}

/* --- View Specific Styles --- */
#view-disconnected, #view-connected {
    padding: 2rem 0; /* 上下の余白を確保 */
}

#status {
    color: #5f6368;
    font-style: italic;
    font-size: 0.9rem;
    margin-top: 1rem;
}

#heartRate-live-view {
    margin-bottom: 1.5rem;
    line-height: 1;
}

#heartRate-live-view #heartRate {
    font-size: 6rem;
    font-weight: 300;
    color: #333;
    letter-spacing: -0.05em;
}

#heartRate-live-view .unit {
    font-size: 1.5rem;
    color: #888;
    margin-left: 0.5rem;
}

.device-link {
    font-size: 0.8rem;
    color: #aaa;
    margin-top: 2rem;
    margin-bottom: 0;
}

.device-link a {
    color: #888;
    text-decoration: none;
}
.device-link a:hover {
    text-decoration: underline;
}

/* --- Green Screen Mode --- */
body.green-screen {
    background-color: #00ff00;
}

body.green-screen .container {
    background-color: transparent;
    box-shadow: none;
}

body.green-screen h1,
body.green-screen #status,
body.green-screen .device-link {
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

body.green-screen #heartRate-live-view #heartRate,
body.green-screen #heartRate-live-view .unit {
    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

body.green-screen .device-link a {
    color: #ffffff;
}

body.green-screen #status {
    color: #eeeeee;
}

body.green-screen #connectButton {
    background-color: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.6);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

body.green-screen #connectButton:hover {
    background-color: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.8);
}

body.green-screen .top-right-controls button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}